Created
December 14, 2015 10:47
-
-
Save ncrmro/bc5e0e3d29a55120ae33 to your computer and use it in GitHub Desktop.
A file for deploying a development mongoDB
This file contains 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
FROM debian:wheezy | |
# add our user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added | |
RUN groupadd -r mongodb && useradd -r -g mongodb mongodb | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends \ | |
ca-certificates curl \ | |
numactl \ | |
&& rm -rf /var/lib/apt/lists/* | |
# grab gosu for easy step-down from root | |
RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 | |
RUN curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.6/gosu-$(dpkg --print-architecture)" \ | |
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.6/gosu-$(dpkg --print-architecture).asc" \ | |
&& gpg --verify /usr/local/bin/gosu.asc \ | |
&& rm /usr/local/bin/gosu.asc \ | |
&& chmod +x /usr/local/bin/gosu | |
# pub 4096R/AAB2461C 2014-02-25 [expires: 2016-02-25] | |
# Key fingerprint = DFFA 3DCF 326E 302C 4787 673A 01C4 E7FA AAB2 461C | |
# uid MongoDB 2.6 Release Signing Key <packaging@mongodb.com> | |
# | |
# pub 4096R/EA312927 2015-10-09 [expires: 2017-10-08] | |
# Key fingerprint = 42F3 E95A 2C4F 0827 9C49 60AD D68F A50F EA31 2927 | |
# uid MongoDB 3.2 Release Signing Key <packaging@mongodb.com> | |
# | |
ENV GPG_KEYS \ | |
DFFA3DCF326E302C4787673A01C4E7FAAAB2461C \ | |
42F3E95A2C4F08279C4960ADD68FA50FEA312927 | |
RUN set -ex \ | |
&& for key in $GPG_KEYS; do \ | |
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys "$key"; \ | |
done | |
ENV MONGO_MAJOR 3.2 | |
ENV MONGO_VERSION 3.2.0 | |
RUN echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/$MONGO_MAJOR main" > /etc/apt/sources.list.d/mongodb-org.list | |
RUN set -x \ | |
&& apt-get update \ | |
&& apt-get install -y \ | |
mongodb-org=$MONGO_VERSION \ | |
mongodb-org-server=$MONGO_VERSION \ | |
mongodb-org-shell=$MONGO_VERSION \ | |
mongodb-org-mongos=$MONGO_VERSION \ | |
mongodb-org-tools=$MONGO_VERSION \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& rm -rf /var/lib/mongodb \ | |
&& mv /etc/mongod.conf /etc/mongod.conf.orig | |
RUN mkdir -p /data/db && chown -R mongodb:mongodb /data/db | |
VOLUME /data/db | |
COPY docker-entrypoint.sh /entrypoint.sh | |
ENTRYPOINT ["/entrypoint.sh"] | |
EXPOSE 27017 | |
CMD ["mongod"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment