what is 'z' flag in docker container's volumes-from option?

While going through the docker docs, I came across volumes-from (https://docs.docker.com/engine/reference/commandline/run/) option for docker run command.
I didn’t understand the differences between ro, rw, and z option provided as-
$ docker run --volumes-from ba8c0c54f0f2:ro -i -t ubuntu pwd
In the above command the ro option is replaced with z. I will be thankful if anyone explores on differences of using these options.

  • Docker Mysql container root password [mysqld listens port 0]
  • Docker - one process per container?
  • Couldn't resolve host within docker container and java process
  • force refresh of docker image when updated in registry / kubernetes
  • Docker exec command
  • Git clone not working with npm
  • Why does AWS have two services to deploy Docker (one “Infra” and one “Platform”)?
  • Good strategy for using docker with mongo and data [closed]
  • Elastic Beanstalk with Docker deployment failure
  • How does Hotspot JVM determine exactly the current timezone on Linux(Centos)?
  • Appcrash KERNELBASE.dll error when I try to use Microsoft Office in Docker Container
  • How do I point a docker image to my .m2 directory for running maven in docker on a mac?
  • 2 Solutions collect form web for “what is 'z' flag in docker container's volumes-from option?”

    Two suffixes :z or :Z can be added to the volume mount. These suffixes tell Docker to relabel file objects on the shared volumes. The ‘z’ option tells Docker that the volume content will be shared between containers. Docker will label the content with a shared content label. Shared volumes labels allow all containers to read/write content. The ‘Z’ option tells Docker to label the content with a private unshared label.


    docker run –volumes-from a64f10cd5f0e:z -i -t rhel6 bin/bash

    I have tested it, i have mounted in one container and from that container to another newly container. IT goes with rw option

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.