0

I have an percona/percona-server-mongodb image of mongo. I tried to mount my mongod.conf.

How to set config and run mongo with config file?

docker run --name mongo1 -v /opt/mongo/mongod3.conf:/etc/mongod.conf  -d percona/percona-server-mongodb
  • Answer from Percona's team shown below, just to say that you might also find some good content among the (free) webinars or the technical blog if you haven't seen them yet (on the Percona site) https://www.percona.com/resources/webinars – greenweeds Dec 29 '17 at 12:31

1 Answers1

1

Very nearly there, just need to add “--config /etc/mongod.conf” to tell Percona Server for MongoDB to use your config file (mapped to /etc/mongod.conf) - the full command you need is here:

docker run --name mongo1 -v /opt/mongo/mongod3.conf:/etc/mongod.conf  -d percona/percona-server-mongodb --config /etc/mongod.conf

For info: I work for Percona

greenweeds
  • 241
  • 1
  • 5
  • Thanks for the answer. But after this command I have an error. about to fork child process, waiting until server is ready for connections. forked process: 8 ERROR: child process failed, exited with error number 1 – Meiram Chuzhenbayev Jan 03 '18 at 02:46
  • Does this discussion help with that (suggests a permissions or path issue)? https://stackoverflow.com/questions/28591101/starting-mongod-fork-error-child-process-failed-exited-with-error-number-1 – greenweeds Jan 04 '18 at 15:50