Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DBZ-848 Preparing Docker example image for MongoDB for a replica set #109

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gunnarmorling
Copy link
Member

Basis for MongoDB replica set example

RUN chmod +x /usr/local/bin/init-inventory-replicaset.sh

# CMD ["mongod", "--replSet", "rs0", "--auth"]
CMD ["mongod", "--replSet", "rs0"]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpechane, any idea how to make the "--auth" parameter optional, depending on how an env var passed when starting a container from that image? I could create a separate file of course but really hoped it can be avoided, so the example image can be use clustered and non-clustered. Thanks!

I.e. what I'm looking for is this:

if (USE_AUTH) {
     CMD ["mongod", "--replSet", "rs0", "--auth"]
}
else {
     CMD ["mongod", "--replSet", "rs0"]
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about introducing a script that will start the mongo and use it in CMD instruction? The script can then easily add/remove options as needed?

@gunnarmorling
Copy link
Member Author

gunnarmorling commented Dec 12, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants