Skip to content

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

Closed
gunnarmorling wants to merge 1 commit into
debezium:mainfrom
gunnarmorling:mongodb-replicaset
Closed

gunnarmorling wants to merge 1 commit into
debezium:mainfrom
gunnarmorling:mongodb-replicaset

Conversation

@gunnarmorling

Copy link
Copy Markdown
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"]

@gunnarmorling gunnarmorling Dec 11, 2018

Copy link
Copy Markdown
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
Copy Markdown
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

gunnarmorling commented Dec 12, 2018 via email

Copy link
Copy Markdown
Member Author

@jcechace

jcechace commented Jul 4, 2024

Copy link
Copy Markdown
Member

Closing as this might be slightly outdated now in 2024 :D

@jcechace jcechace closed this Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants