Skip to content

Instantly share code, notes, and snippets.

@evangelicaldev
Created April 4, 2020 18:47
Show Gist options
  • Save evangelicaldev/cac5e279c3bc2f49d7e8601f572749cb to your computer and use it in GitHub Desktop.
Save evangelicaldev/cac5e279c3bc2f49d7e8601f572749cb to your computer and use it in GitHub Desktop.
Dockerfile MongoDB 4.2 and 3.6
FROM ubuntu
COPY <cert file> .
RUN apt-get update
RUN apt-get install -y wget gnupg
RUN wget -qO - https://www.mongodb.org/static/pgp/server-3.6.asc | apt-key add -
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.6.list
RUN apt-get update
RUN apt-get install -y mongodb-org
ENV USERNAME=<username>
ENV PASSWORD=<password>
FROM ubuntu
COPY <cert file> .
RUN apt-get update
RUN apt-get install -y wget gnupg
RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | apt-key add -
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.2.list
RUN apt-get update
RUN apt-get install -y mongodb-org
ENV USERNAME=<username>
ENV PASSWORD=<password>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment