DBZ-848 Preparing Docker example image for MongoDB for a replica set - #109
Closed
gunnarmorling wants to merge 1 commit into
Closed
gunnarmorling wants to merge 1 commit into
gunnarmorling wants to merge 1 commit into
Conversation
gunnarmorling
commented
Dec 11, 2018
| RUN chmod +x /usr/local/bin/init-inventory-replicaset.sh | ||
|
|
||
| # CMD ["mongod", "--replSet", "rs0", "--auth"] | ||
| CMD ["mongod", "--replSet", "rs0"] |
Member
Author
There was a problem hiding this comment.
@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"]
}
Contributor
There was a problem hiding this comment.
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?
Member
Author
|
Yes, that's of course an option. I kinda hoped there was a way to do it
just within Dockerfile, but I'll go for the script then.
|
Member
|
Closing as this might be slightly outdated now in 2024 :D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basis for MongoDB replica set example