Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 185e372

Browse filesBrowse files
committed
Remove restriction on anonymous read-only volumes
Remove restriction on anonymouse read-only volumes. This restriction is currently preventing the use of pre-populated volumes that should be accessed in a read-only manner in a container (e.g. an NFS volume containing data to be processed or served). According to @neersighted the restriction may have originally been put in place with the assumption that pre-populated volumes would be exposed as a named volume by the volume driver. In practice, NFS volumes are mounted using the docker `local` driver by supplying driver opts. Example that fails when `readonly` is specified but works without: ``` docker run --rm -it \ --mount 'readonly,type=volume,dst=/data/dest,volume-driver=local,volume-opt=type=nfs,volume-opt=device=:/export/some-share,"volume-opt=o=nfsvers=4,addr=some.server"' \ debian ``` Fixes #45297
1 parent c64b781 commit 185e372
Copy full SHA for 185e372

2 files changed

-7Lines changed: 0 additions & 7 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎daemon/volume/mounts/linux_parser.go‎

Copy file name to clipboardExpand all lines: daemon/volume/mounts/linux_parser.go
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ func (p *linuxParser) validateMountConfigImpl(mnt *mount.Mount, validateBindSour
112112
return &errMountConfig{mnt, errInvalidSubpath}
113113
}
114114
}
115-
if mnt.ReadOnly && anonymousVolume {
116-
return &errMountConfig{mnt, errors.New("must not set ReadOnly mode when using anonymous volumes")}
117-
}
118115
case mount.TypeTmpfs:
119116
if mnt.BindOptions != nil {
120117
return &errMountConfig{mnt, errExtraField("BindOptions")}
Collapse file

‎daemon/volume/mounts/windows_parser.go‎

Copy file name to clipboardExpand all lines: daemon/volume/mounts/windows_parser.go
-4Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,6 @@ func (p *windowsParser) validateMountConfigReg(mnt *mount.Mount, additionalValid
270270
}
271271
}
272272

273-
if anonymousVolume && mnt.ReadOnly {
274-
return &errMountConfig{mnt, errors.New("must not set ReadOnly mode when using anonymous volumes")}
275-
}
276-
277273
if mnt.Source != "" {
278274
if err := p.ValidateVolumeName(mnt.Source); err != nil {
279275
return &errMountConfig{mnt, err}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.