diff --git a/docker/Dockerfile b/docker/Dockerfile index d05787be..1b227f49 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM frolvlad/alpine-glibc:alpine-3.12 +FROM debian:stable-slim LABEL maintainer="https://github.com/factoriotools/factorio-docker" @@ -26,7 +26,7 @@ ENV PORT=34197 \ PUID="$PUID" \ PGID="$PGID" -SHELL ["/bin/ash", "-eo", "pipefail", "-c"] +SHELL ["/bin/bash", "-eo", "pipefail", "-c"] RUN set -ox pipefail \ && if [[ "${VERSION}" == "" ]]; then \ echo "build-arg VERSION is required" \ @@ -38,7 +38,9 @@ RUN set -ox pipefail \ fi \ && 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 \ + && apt-get -q update \ + && DEBIAN_FRONTEND=noninteractive apt-get -qy install ca-certificates curl jq pwgen xz-utils --no-install-recommends \ + && rm -rf /var/lib/apt/lists/* \ && curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" --retry $CURL_RETRIES\ && echo "$SHA256 $archive" | sha256sum -c \ || (sha256sum "$archive" && file "$archive" && exit 1) \ @@ -48,8 +50,8 @@ RUN set -ox pipefail \ && ln -s "$SCENARIOS" /opt/factorio/scenarios \ && ln -s "$SAVES" /opt/factorio/saves \ && mkdir -p /opt/factorio/config/ \ - && addgroup -g "$PGID" -S "$GROUP" \ - && adduser -u "$PUID" -G "$GROUP" -s /bin/sh -SDH "$USER" \ + && addgroup --system --gid "$PGID" "$GROUP" \ + && adduser --system --uid "$PUID" --gid "$PGID" --no-create-home --disabled-password --shell /bin/sh "$USER" \ && chown -R "$USER":"$GROUP" /opt/factorio /factorio COPY files/*.sh / diff --git a/docker/files/docker-entrypoint.sh b/docker/files/docker-entrypoint.sh index a27494f7..0fa6f6a7 100755 --- a/docker/files/docker-entrypoint.sh +++ b/docker/files/docker-entrypoint.sh @@ -50,7 +50,7 @@ if [[ $(id -u) = 0 ]]; then # Take ownership of factorio data if running as root chown -R factorio:factorio "$FACTORIO_VOL" # Drop to the factorio user - SU_EXEC="su-exec factorio" + SU_EXEC="runuser -u factorio -g factorio --" else SU_EXEC="" fi