docs icon indicating copy to clipboard operation
docs copied to clipboard

Question about mount mode.

Open bbbmj opened this issue 8 years ago • 10 comments

File: storage/volumes.md

Question

Q: The actual mode is z, not ro,why ?

Run:

docker run -d \
  --name=nginxtest \
  --mount source=nginx-vol,destination=/usr/share/nginx/html,readonly \
  nginx:latest

Use docker inspect nginxtest to verify that the readonly mount was created correctly. Look for the Mounts section:

"Mounts": [
    {
        "Type": "volume",
        "Name": "nginx-vol",
        "Source": "/var/lib/docker/volumes/nginx-vol/_data",
        "Destination": "/usr/share/nginx/html",
        "Driver": "local",
        "Mode": "z",
        "RW": false,
        "Propagation": ""
    }
],

Env

$ docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:21:31 2018
 OS/Arch:           darwin/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:29:02 2018
  OS/Arch:          linux/amd64
  Experimental:     true

$ docker info
Containers: 2
 Running: 0
 Paused: 0
 Stopped: 2
Images: 20
Server Version: 18.06.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 1.46GiB
Name: linuxkit-025000000001
ID: NP2D:KF6O:NH3G:TAOA:NJV4:G4RQ:PKE4:3NLC:ZCKY:XSB6:I6PW:MER4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 26
 Goroutines: 53
 System Time: 2018-09-22T16:05:26.1718392Z
 EventsListeners: 2
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

bbbmj avatar Sep 22 '18 16:09 bbbmj

@bermudezmt PTAL

bbbmj avatar Sep 22 '18 16:09 bbbmj

@bermudezmt It looks like @bbbmj loves what you did :) Ok to merge?

ahh-docker avatar Sep 24 '18 19:09 ahh-docker

Hey @bbbmj , I've been pretty slammed but checked this just now. I'm seeing the same mount output as in the doc:

"Mounts": [
            {
                "Type": "volume",
                "Name": "nginx-vol",
                "Source": "/var/lib/docker/volumes/nginx-vol/_data",
                "Destination": "/usr/share/nginx/html",
                "Driver": "local",
                "Mode": "",
                "RW": false,
                "Propagation": ""
            }
        ]

I am however running Docker EE 2.0. Did you check with other version of Docker CE?

bermudezmt avatar Oct 18 '18 17:10 bermudezmt

Thanks to your reply @bermudezmt

Both in my Mac and VM, it's output z

image

VM Env

$ docker version
Client:
 Version:           18.06.1-ce
 API version:       1.38
 Go version:        go1.10.3
 Git commit:        e68fc7a
 Built:             Tue Aug 21 17:23:03 2018
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          18.06.1-ce
  API version:      1.38 (minimum version 1.12)
  Go version:       go1.10.3
  Git commit:       e68fc7a
  Built:            Tue Aug 21 17:25:29 2018
  OS/Arch:          linux/amd64
  Experimental:     false
$ uname -a
Linux qa4v44 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

bbbmj avatar Oct 19 '18 01:10 bbbmj

@thaJeztah would you happen to know why this is the case for 18.06.1-ce? I'm seeing an empty value for mount mode running the example command on Docker EE 2.0 (17.06.2-ee-16) which is what we're showing in the docs.

bermudezmt avatar Oct 19 '18 05:10 bermudezmt

@mark-church Assigned to you as not a docs issue.

JustinINevill avatar Dec 11 '18 19:12 JustinINevill

Looks like this may be related to a fix that is in Docker 17.09, but not in 17.06; https://github.com/moby/moby/pull/34684. I see it was backported at some point, but reverted (I'll check what's the reason for that)

thaJeztah avatar Dec 11 '18 22:12 thaJeztah

Looks like that patch caused some issues in tests. Later versions use a different implementation which may not have that issue

thaJeztah avatar Dec 11 '18 22:12 thaJeztah

@bbbmj I hope your original question had been answered by @thaJeztah above. Please feel free to submit another issue if this isn't the case. Thanks!

bermudezmt avatar Apr 17 '19 23:04 bermudezmt

Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

/lifecycle locked

docker-robott avatar Mar 14 '23 03:03 docker-robott