From f5ffae1cb49c609c78228fac6ed2c686bea143d9 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 26 Feb 2019 19:44:26 +0000 Subject: [PATCH] make scripts executable --- 0.17/Dockerfile | 2 +- 0.17/files/docker-entrypoint.sh | 8 +++++++- 0.17/files/scenario.sh | 0 0.17/files/scenario2map.sh | 0 4 files changed, 8 insertions(+), 2 deletions(-) mode change 100644 => 100755 0.17/files/docker-entrypoint.sh mode change 100644 => 100755 0.17/files/scenario.sh mode change 100644 => 100755 0.17/files/scenario2map.sh diff --git a/0.17/Dockerfile b/0.17/Dockerfile index b10e6fa..9824664 100644 --- a/0.17/Dockerfile +++ b/0.17/Dockerfile @@ -41,6 +41,6 @@ EXPOSE $PORT/udp $RCON_PORT/tcp COPY files/ / -USER $USER +#USER $USER ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/0.17/files/docker-entrypoint.sh b/0.17/files/docker-entrypoint.sh old mode 100644 new mode 100755 index 3aee1b8..db7f900 --- a/0.17/files/docker-entrypoint.sh +++ b/0.17/files/docker-entrypoint.sh @@ -3,6 +3,8 @@ set -e id +FACTORIO_VOL=/factorio +mkdir -p $FACTORIO_VOL mkdir -p $SAVES mkdir -p $CONFIG mkdir -p $MODS @@ -36,7 +38,11 @@ if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then --map-settings $CONFIG/map-settings.json fi -exec /opt/factorio/bin/x64/factorio \ +if [ "$(id -u)" = '0' ]; then + chown -R factorio:factorio $FACTORIO_VOL +fi + +exec gosu factorio /opt/factorio/bin/x64/factorio \ --port $PORT \ --start-server-load-latest \ --server-settings $CONFIG/server-settings.json \ diff --git a/0.17/files/scenario.sh b/0.17/files/scenario.sh old mode 100644 new mode 100755 diff --git a/0.17/files/scenario2map.sh b/0.17/files/scenario2map.sh old mode 100644 new mode 100755