1

mongo docker image can be started using some command like this:

docker run --name some-mongo -d mongo --auth

This works fine, but now my cloud service provider is using docker-compose, and I don't have access to docker run, all I can do is to modify that .yml file that used with docker-compose.

So my question is how can I pass that --auth command line arg to docker-compose using that .yml config file? Or do I understand this in a totally wrong way? Anyway I just want to start my mongo image with auth enabled.

Liang
  • 1,127
  • 2
  • 11
  • 22

1 Answers1

1

This was answered earlier here(how to add --auth for mongodb image when using docker-compose?). auth here is an option to mongo container. In docker compose, we can specify the same in "command" parameter.

Sreeni
  • 748
  • 5
  • 6