moved env to Dockerfile so they can be shared

This commit is contained in:
David Andersen 2018-03-12 16:54:17 +00:00
parent 66d4652302
commit 9ac04bcff8
2 changed files with 11 additions and 12 deletions

View File

@ -10,7 +10,12 @@ ARG PGID=845
ENV PORT=34197 \ ENV PORT=34197 \
RCON_PORT=27015 \ RCON_PORT=27015 \
VERSION=0.16.29 \ VERSION=0.16.29 \
SHA1=4015ab311b3b769f9ac2fb33f83d0ee3474c6cc7 SHA1=4015ab311b3b769f9ac2fb33f83d0ee3474c6cc7 \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
ENTRYPOINTS=/factorio/entrypoints
RUN mkdir -p /opt /factorio && \ RUN mkdir -p /opt /factorio && \
apk add --update --no-cache pwgen && \ apk add --update --no-cache pwgen && \
@ -21,10 +26,10 @@ RUN mkdir -p /opt /factorio && \
tar xf /tmp/factorio_headless_x64_$VERSION.tar.xz --directory /opt && \ tar xf /tmp/factorio_headless_x64_$VERSION.tar.xz --directory /opt && \
chmod ugo=rwx /opt/factorio && \ chmod ugo=rwx /opt/factorio && \
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \ rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
ln -s -f /factorio/saves /opt/factorio/saves && \ ln -s -f $SAVES /opt/factorio/saves && \
ln -s -f /factorio/mods /opt/factorio/mods && \ ln -s -f $MODS /opt/factorio/mods && \
ln -s -f /factorio/scenarios /opt/factorio/scenarios && \ ln -s -f $SCENARIOS /opt/factorio/scenarios && \
ln -s -f /factorio/entrypoints /opt/factorio/entrypoints && \ ln -s -f $ENTRYPOINTS /opt/factorio/entrypoints && \
apk del .build-deps && \ apk del .build-deps && \
addgroup -g $PGID -S $GROUP && \ addgroup -g $PGID -S $GROUP && \
adduser -u $PUID -G $GROUP -s /bin/sh -SDH $USER && \ adduser -u $PUID -G $GROUP -s /bin/sh -SDH $USER && \
@ -39,7 +44,7 @@ COPY ./scenario2map.sh /factorio/entrypoints
COPY ./scenario.sh /factorio/entrypoints COPY ./scenario.sh /factorio/entrypoints
#symbolic link the default entrypoint to the entrypoints directory so it can be inspected and copied to new entrypoints #symbolic link the default entrypoint to the entrypoints directory so it can be inspected and copied to new entrypoints
ln -s -f /docker-entrypoint.sh $ENTRYPOINTS/docker-entrypoint.sh #RUN ln -s -f /docker-entrypoint.sh $ENTRYPOINTS/docker-entrypoint.sh
USER $USER USER $USER

View File

@ -4,12 +4,6 @@ set -e
id id
SAVES=/factorio/saves
CONFIG=/factorio/config
MODS=/factorio/mods
SCENARIOS=/factorio/scenarios
ENTRYPOINTS=/factorio/entrypoints
mkdir -p $SAVES mkdir -p $SAVES
mkdir -p $CONFIG mkdir -p $CONFIG
mkdir -p $MODS mkdir -p $MODS