Overriding VOLUME directive in a Dockerfile

I’m building my own image on top of docker.io/mongo:3.2, but I have a problem with persisting some changes (creating new users) in the build process.

I’m aware that this happens because the users are created in the /data/db, which is defined as VOLUME in the original MongoDB Dockerfile.

  • Strange error about permissions inside a docker container
  • What's the difference when installing docker with 2 of these following command?
  • docker run ubuntu on mac and nothing happens
  • Docker: how to build an image from a non-master branch on Github repository
  • Using linked container environment variables in application environment?
  • can't run fig up it always gets killed
  • My question is if there is a way I can add users during the build process and make those changes persist the build process.

    Alternatively, if that isn’t possible, how can I add the DB users during the build process of my image?

  • ip address for google app engine node js docker application
  • hub.docker.io reports tags in the web interface but we cannot some of them using the API
  • where are $POSTGRES_PORT_5432_TCP_ADDR and $POSTGRES_PORT_5432_TCP_PORT come from?
  • Why does Docker say it can't execute 'bash"?
  • Host redirection not working boot2docker
  • NFS in Docker: exportfs: <path> does not support NFS export
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.