Liang
Liang

Reputation: 1187

How to pass docker run command line arg to docker-compose?

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.

Upvotes: 1

Views: 2264

Answers (1)

Sreeni
Sreeni

Reputation: 778

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.

Upvotes: 2

Related Questions