It is pretty confusing that there is a line in the script that move the default configuration to mongo.conf.orig
https://github.com/docker-library/mongo/blob/master/3.0/Dockerfile#L43
It makes me think that I if want mongo to use my special configuration I just need to COPY ./mongod.conf /etc/mongo.conf and rejoice, since the /entrypoint.sh script will pick it up. Sadly this does not appear to be the case for image 3.0 I have to instead specify in the command CMD ["--config", "/etc/mongo.conf"] which is fine it just should be better documented.
Since mongo does not read a config file by default, we moved it so that users would not think that it applied while still keeping an example file. I guess we need to update the readme to show how to use a config file: docker run -d -v /my/local/mongo.conf:/etc/mongo.conf mongo --config /etc/mongo.conf.
yes please
@yosifkit I think there should be a document to show how to use config file with docker-compose config , as mongo container always be used to linked to other application container, so docker-compose is very convenience to config.
Docs (finally :open_mouth:) added in https://github.com/docker-library/docs/pull/1127.
Most helpful comment
Since mongo does not read a config file by default, we moved it so that users would not think that it applied while still keeping an example file. I guess we need to update the readme to show how to use a config file:
docker run -d -v /my/local/mongo.conf:/etc/mongo.conf mongo --config /etc/mongo.conf.