Hi all
I downloaded mongodb image .How I can enable mongod.conf ???
Regards
Haven’t done this before but a quick read over this thread and specifically this example:
First you want to specify the volume flag with `-v` to map a file or directory from the host to the container. So if you had a config file located at `/home/ubuntu/` and wanted to place it within the `/etc/` folder of the container you would specify it with the following:
-v /home/ubuntu/mongod.conf:/etc/mongod.conf
Then specify the command for mongo to read the config file after the image like so:
mongo -f /etc/mongod.conf
If you put it all together, you'll get something like this:
docker run -d --net="host" --name mongo-host -v /home/ubuntu/mongod.conf:/etc/mongod.conf mongo -f /etc/mongod.conf
I think would translate to this in the Portainer UI:
Note: you may need to omit -f
from the command so it just becomes /etc/mongod.conf