UNCLASSIFIED

Commit 6285f55a authored by WingKwan Lau's avatar WingKwan Lau
Browse files

Update Dockerfile, LICENSE files

parent 14620d7b
Pipeline #379480 failed with stages
in 20 seconds
ARG BASE_REGISTRY=registry1.dso.mil
ARG BASE_IMAGE=mongo/mongo
ARG BASE_TAG=latest
FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG}
# switch to root in order to fix permissions
USER root
# define Mongo's data and configuration directories
ENV DATA_DIR=/data/db \
CONFIG_DIR=/data/configdb \
WORKING_DIR=/home/containeruser
# create container user's home directory
RUN mkdir -p $WORKING_DIR
# copy over the script to make permissions compatible with OpenShift
COPY IronbankFiles/scripts/fix-permissions.sh /usr/local/bin
# ensure the script is executable
RUN chmod a+x /usr/local/bin/fix-permissions.sh
# set up container user and adjust permissions to run in OpenShift environment
RUN fix-permissions.sh ${DATA_DIR} -P && \
fix-permissions.sh ${CONFIG_DIR} -P && \
fix-permissions.sh ${WORKING_DIR} -P
RUN ls -ltrh ${DATA_DIR}
RUN ls -ltrh ${CONFIG_DIR}
RUN ls -ltrh ${WORKING_DIR}
# set home directory to persistent volume directory
ENV HOME=/var/lib/mongodb/data
# switch back to mongodb (for non-containerized environments)
USER mongodb:mongodb
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment