1

I created a mongo docker instance and by default it doesn't have auth enabled.

So i created a root user and a read/write user for a database, and now I want to restart it in auth mode, which is usually done by passing the --auth argument on startup.

Is it possible to restart the mongo docker instance with the additional flag?

1 Answer 1

2

Yes, you can launch the container with an alternate command including any extra parameters: docker run [opts] mongodb mongod --auth

The overall structure is docker run [docker run options] [containername] [alternate command to run] [args for the command].

Sign up to request clarification or add additional context in comments.

1 Comment

Nobody noticed the question was about docker start, not docker run !?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.