7

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.

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?

alexandernst
  • 14,352
  • 22
  • 97
  • 197
  • 3
    I have asked a similar question before, and you may benefit from some of the answers there: http://stackoverflow.com/questions/26315680/how-to-undeclare-volumes-in-docker-image – Mikkel May 14 '16 at 19:29

0 Answers0