Skip to content

Instantly share code, notes, and snippets.

@tashian
Created October 5, 2021 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tashian/2b6d29735d03bdf775cb442bfe923270 to your computer and use it in GitHub Desktop.
Save tashian/2b6d29735d03bdf775cb442bfe923270 to your computer and use it in GitHub Desktop.
A MongoDB Dockerfile that bootstraps with a step-ca Certificate Authority for root CA trust, using the step command
FROM smallstep/step-cli as step
FROM mongo
COPY --from=step /usr/local/bin/step /usr/local/bin/
ARG CA_URL
ARG CA_FINGERPRINT
ENV CA_URL=${CA_URL} CA_FINGERPRINT=${CA_FINGERPRINT}
RUN step ca bootstrap --ca-url $CA_URL --fingerprint $CA_FINGERPRINT --install
@tashian
Copy link
Author

tashian commented Oct 5, 2021

CA_URL and CA_FINGERPRINT should be supplied as build args, eg.

docker build . --build-arg "CA_FINGERPRINT=c8de28e...620ecaa" \
        --build-arg "CA_URL=https://ca:4443/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment