moved entry points to /; dont put hard link in place of entrypoint folder

This commit is contained in:
David Andersen 2018-03-19 16:58:53 +00:00
parent 10f891cabf
commit 66bef56cd2
5 changed files with 9 additions and 27 deletions

View File

@ -14,8 +14,7 @@ ENV PORT=34197 \
SAVES=/factorio/saves \ SAVES=/factorio/saves \
CONFIG=/factorio/config \ CONFIG=/factorio/config \
MODS=/factorio/mods \ MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \ 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 && \
@ -26,10 +25,9 @@ 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 $SAVES /opt/factorio/saves && \ ln -s $SAVES /opt/factorio/saves && \
ln -s -f $MODS /opt/factorio/mods && \ ln -s $MODS /opt/factorio/mods && \
ln -s -f $SCENARIOS /opt/factorio/scenarios && \ ln -s $SCENARIOS /opt/factorio/scenarios && \
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 && \
@ -40,11 +38,8 @@ VOLUME /factorio
EXPOSE $PORT/udp $RCON_PORT/tcp EXPOSE $PORT/udp $RCON_PORT/tcp
COPY ./docker-entrypoint.sh / COPY ./docker-entrypoint.sh /
COPY ./scenario2map.sh /factorio/entrypoints COPY ./scenario2map.sh /
COPY ./scenario.sh /factorio/entrypoints COPY ./scenario.sh /
#symbolic link the default entrypoint to the entrypoints directory so it can be inspected and copied to new entrypoints
#RUN ln -s -f /docker-entrypoint.sh $ENTRYPOINTS/docker-entrypoint.sh
USER $USER USER $USER

View File

@ -7,8 +7,7 @@ id
mkdir -p $SAVES mkdir -p $SAVES
mkdir -p $CONFIG mkdir -p $CONFIG
mkdir -p $MODS mkdir -p $MODS
mkdir -p $SCENARIOS
#chown -R factorio /factorio
if [ ! -f $CONFIG/rconpw ]; then if [ ! -f $CONFIG/rconpw ]; then
echo $(pwgen 15 1) > $CONFIG/rconpw echo $(pwgen 15 1) > $CONFIG/rconpw

View File

@ -9,11 +9,6 @@ set -e
id id
SAVES=/factorio/saves
CONFIG=/factorio/config
MODS=/factorio/mods
SCENARIOS=/factorio/scenarios
mkdir -p $SAVES mkdir -p $SAVES
mkdir -p $CONFIG mkdir -p $CONFIG
mkdir -p $MODS mkdir -p $MODS

View File

@ -9,18 +9,11 @@ set -e
id id
SAVES=/factorio/saves
CONFIG=/factorio/config
MODS=/factorio/mods
SCENARIOS=/factorio/scenarios
mkdir -p $SAVES mkdir -p $SAVES
mkdir -p $CONFIG mkdir -p $CONFIG
mkdir -p $MODS mkdir -p $MODS
mkdir -p $SCENARIOS mkdir -p $SCENARIOS
#chown -R factorio /factorio
if [ ! -f $CONFIG/server-settings.json ]; then if [ ! -f $CONFIG/server-settings.json ]; then
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
fi fi

View File

@ -124,7 +124,7 @@ docker run -d \
-v /opt/factorio:/factorio \ -v /opt/factorio:/factorio \
--name factorio \ --name factorio \
--restart=always \ --restart=always \
--entrypoint "/factorio/entrypoints/scenario.sh" \ --entrypoint "/scenario.sh" \
dtandersen/factorio \ dtandersen/factorio \
MyScenarioName MyScenarioName
``` ```
@ -140,7 +140,7 @@ docker run -d \
-v /opt/factorio:/factorio \ -v /opt/factorio:/factorio \
--name factorio \ --name factorio \
--restart=always \ --restart=always \
--entrypoint "/factorio/entrypoints/scenario2map.sh" \ --entrypoint "/scenario2map.sh" \
dtandersen/factorio dtandersen/factorio
MyScenarioName MyScenarioName
``` ```