factorio-docker/0.17/Dockerfile

44 lines
1.4 KiB
Docker
Raw Normal View History

2020-05-18 02:42:35 +02:00
FROM frolvlad/alpine-glibc:alpine-3.11
2019-02-26 20:24:59 +01:00
2019-05-15 13:07:30 +02:00
LABEL maintainer="https://github.com/factoriotools/factorio-docker"
2019-02-26 20:24:59 +01:00
ARG USER=factorio
ARG GROUP=factorio
ARG PUID=845
ARG PGID=845
ENV PORT=34197 \
RCON_PORT=27015 \
2019-11-19 15:32:54 +01:00
VERSION=0.17.79 \
SHA1=7f127baf3cf01c6e545a9ca376dec1ac37468f8a \
2019-02-26 20:24:59 +01:00
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
SCRIPTOUTPUT=/factorio/script-output \
2019-05-17 09:11:09 +02:00
PUID="$PUID" \
PGID="$PGID"
2019-02-26 20:24:59 +01:00
2020-05-18 02:34:53 +02:00
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
2019-07-13 12:23:01 +02:00
RUN set -ox pipefail \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \
&& apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \
&& curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" \
&& echo "$SHA1 $archive" | sha1sum -c \
|| (sha1sum "$archive" && file "$archive" && exit 1) \
&& tar xf "$archive" --directory /opt \
2019-07-13 12:04:34 +02:00
&& chmod ugo=rwx /opt/factorio \
2019-07-13 12:23:01 +02:00
&& rm "$archive" \
&& mkdir -p /opt/factorio/config/ \
2019-07-13 12:04:34 +02:00
&& addgroup -g "$PGID" -S "$GROUP" \
&& adduser -u "$PUID" -G "$GROUP" -s /bin/sh -SDH "$USER" \
&& chown -R "$USER":"$GROUP" /opt/factorio /factorio
2019-02-26 20:24:59 +01:00
COPY files/*.sh /
COPY files/config.ini /opt/factorio/config/config.ini
2019-02-26 20:24:59 +01:00
VOLUME /factorio
2019-02-26 20:24:59 +01:00
EXPOSE $PORT/udp $RCON_PORT/tcp
ENTRYPOINT ["/docker-entrypoint.sh"]