FROM registry.fedoraproject.org/fedora:26 ENV NAME=mongodb ARCH=x86_64 LABEL MAINTAINER "Matus Kocka" LABEL summary="MongoDB is a scalable, high-performance, open source NoSQL database." RUN INSTALL_PKGS="bind-utils gettext iproute rsync tar findutils python3 mongodb mongodb-server mongo-tools" && \ dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \ rpm -V $INSTALL_PKGS && \ dnf clean all ENV MONGODB_VERSION=3.2 \ # Set paths to avoid hard-coding them in scripts. HOME=/var/lib/mongodb \ CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/mongodb ADD files / EXPOSE 27017 CMD ["/usr/bin/run-mongod"] # Container setup from scl RUN : > /etc/mongod.conf && \ mkdir -p ${HOME}/data && \ # Set owner 'mongodb:0' and 'g+rw(x)' permission - to avoid problems running container with arbitrary UID /usr/libexec/fix-permissions /etc/mongod.conf ${CONTAINER_SCRIPTS_PATH}/mongodb.conf.template \ ${HOME} VOLUME ["/var/lib/mongodb/data"] USER 184