Prevent volume creation on docker run

Dockerfile can contain VOLUME /path instruction. That means that when docker run is executed, docker creates automatically a volume and binds it to /path inside container.

I’d like to skip the automatic volume creation in some cases. Is that possible somehow?

  • How much memory needed for build docker v1.9.0
  • How to get memory usage of processes running in docker container?
  • how to centralized log file on docker container?
  • Docker nginx and Go (Golang) separate containers. Nginx configuration
  • Adding host file to docker container - from Dockerfile
  • Setting up Docker on Windows for PHP - can not find config file
  • How stable/reliable are the boot2docker and docker-machine IP addresses?
  • Window version of Docker not able to mount local directory to ubuntu image on container?
  • How to use port forwarding to connect to docker container using DNS name
  • update running docker container
  • Commandline arguments in docker-compose
  • Bash variable inside third remote server
  • One Solution collect form web for “Prevent volume creation on docker run”

    Not once it’s be added to the Dockerfile. I’d personally avoid doing volumes inside of the Dockerfile since it ends up creating anonymous volumes as you’ve seen, but also because it breaks attempts to modify that directory in child images or even later steps inside of the same Dockerfile.

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