Compare commits

...

5 Commits

Author SHA1 Message Date
Marc 'risson' Schmitt
2ba59b4f95
build: build in reverse order of versions (#506)
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2024-10-21 16:00:49 +02:00
Marc 'risson' Schmitt
c269289a96
Improve image stages (#509)
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2024-10-21 15:59:34 +02:00
github-actions[bot]
ee0388e163 Auto Update Factorio to stable version: 2.0.7 experimental version: 2.0.7 2024-10-21 12:52:02 +00:00
Mr BasicX
a1cb15b709
Updated update.sh and clear data from broken github action! (#505)
* Update update.sh to fix SHA256 grabbing

* Update buildinfo.json reverted data so build.sh can run

* Update docker-compose.yml  reverted data so build.sh can run
2024-10-21 14:51:42 +02:00
github-actions[bot]
890489fb15 Auto Update Factorio to stable version: 2.0.7 experimental version: 2.0.7 2024-10-21 11:14:31 +00:00
6 changed files with 44 additions and 30 deletions

View File

@ -6,7 +6,8 @@
[中文](./README_zh_CN.md)
<!-- start autogeneration tags -->
* `1`, `1.1`, `1.1.110`, `latest`, `stable`, `stable-1.1.110`
* `2`, `2.0`, `2.0.7`, `latest`, `stable`, `stable-2.0.7`
* `1`, `1.1`, `1.1.110`, `stable-1.1.110`
* `1.0`, `1.0.0`
* `0.17`, `0.17.79`
* `0.16`, `0.16.51`

View File

@ -92,7 +92,7 @@ def main(push_tags=False, multiarch=False):
if push_tags:
login()
for version, buildinfo in builddata.items():
for version, buildinfo in sorted(builddata.items(), key=lambda item: item[0], reverse=True):
sha256 = buildinfo["sha256"]
tags = buildinfo["tags"]
build_and_push(sha256, version, tags, push_tags, multiarch)

View File

@ -51,12 +51,21 @@
"1.1.110": {
"sha256": "485fe6db36e5decd7dd0d70e7c97e61f818100fa3e48d87884b287027c7a646a",
"tags": [
"latest",
"stable",
"stable-1.1.110",
"1",
"1.1",
"1.1.110"
]
},
"2.0.7": {
"sha256": "e6a64a9ee5b1d3773cd1f40aa5cf78e91960eade6c508fd365c34752afdf2762",
"tags": [
"latest",
"stable",
"stable-2.0.7",
"2",
"2.0",
"2.0.7"
]
}
}

View File

@ -16,19 +16,11 @@ ARG BOX64_VERSION=v0.2.4
# space-exploration
ARG PRESET
# version checksum of the archive to download
ARG VERSION
ARG SHA256
LABEL factorio.version=${VERSION}
# number of retries that curl will use when pulling the headless server tarball
ARG CURL_RETRIES=8
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=${VERSION} \
SHA256=${SHA256} \
SAVES=/factorio/saves \
PRESET="$PRESET" \
CONFIG=/factorio/config \
@ -39,6 +31,31 @@ ENV PORT=34197 \
PGID="$PGID"
SHELL ["/bin/bash", "-eo", "pipefail", "-c"]
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get -qy install ca-certificates curl jq pwgen xz-utils procps gettext-base --no-install-recommends \
&& if [[ "$(uname -m)" == "aarch64" ]]; then \
echo "installing ARM compatability layer" \
&& DEBIAN_FRONTEND=noninteractive apt-get -qy install unzip --no-install-recommends \
&& curl -LO https://github.com/ptitSeb/box64/releases/download/${BOX64_VERSION}/box64-GENERIC_ARM-RelWithDebInfo.zip \
&& unzip box64-GENERIC_ARM-RelWithDebInfo.zip -d /bin \
&& rm -f box64-GENERIC_ARM-RelWithDebInfo.zip \
&& chmod +x /bin/box64; \
fi \
&& rm -rf /var/lib/apt/lists/*
RUN addgroup --system --gid "$PGID" "$GROUP" \
&& adduser --system --uid "$PUID" --gid "$PGID" --no-create-home --disabled-password --shell /bin/sh "$USER"
# version checksum of the archive to download
ARG VERSION
ARG SHA256
LABEL factorio.version=${VERSION}
ENV VERSION=${VERSION} \
SHA256=${SHA256}
RUN set -ox pipefail \
&& if [[ "${VERSION}" == "" ]]; then \
echo "build-arg VERSION is required" \
@ -50,28 +67,15 @@ RUN set -ox pipefail \
fi \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \
&& apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get -qy install ca-certificates curl jq pwgen xz-utils procps gettext-base --no-install-recommends \
&& curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" --retry $CURL_RETRIES\
&& 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) \
&& tar xf "$archive" --directory /opt \
&& chmod ugo=rwx /opt/factorio \
&& rm "$archive" \
&& if [[ "$(uname -m)" == "aarch64" ]]; then \
echo "installing ARM compatability layer" \
&& DEBIAN_FRONTEND=noninteractive apt-get -qy install unzip --no-install-recommends \
&& curl -LO https://github.com/ptitSeb/box64/releases/download/${BOX64_VERSION}/box64-GENERIC_ARM-RelWithDebInfo.zip \
&& unzip box64-GENERIC_ARM-RelWithDebInfo.zip -d /bin \
&& rm -f box64-GENERIC_ARM-RelWithDebInfo.zip \
&& chmod +x /bin/box64; \
fi \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s "$SCENARIOS" /opt/factorio/scenarios \
&& ln -s "$SAVES" /opt/factorio/saves \
&& mkdir -p /opt/factorio/config/ \
&& 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 /

View File

@ -6,8 +6,8 @@ services:
args:
# Check buildinfo.json for supported versions and SHAs
# https://github.com/factoriotools/factorio-docker/blob/master/buildinfo.json
- VERSION=1.1.110
- SHA256=485fe6db36e5decd7dd0d70e7c97e61f818100fa3e48d87884b287027c7a646a
- VERSION=2.0.7
- SHA256=e6a64a9ee5b1d3773cd1f40aa5cf78e91960eade6c508fd365c34752afdf2762
ports:
- "34197:34197/udp"
- "27015:27015/tcp"

View File

@ -4,8 +4,8 @@ SEMVER_REGEX="^(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
stable_online_version=$(curl 'https://factorio.com/api/latest-releases' | jq '.stable.headless' -r)
experimental_online_version=$(curl 'https://factorio.com/api/latest-releases' | jq '.experimental.headless' -r)
stable_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep "factorio_headless_x64_${stable_online_version}.tar.xz" | awk '{print $1}')
experimental_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep "factorio_headless_x64_${experimental_online_version}.tar.xz" | awk '{print $1}')
stable_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep -E "(factorio_headless_x64_|factorio-headless_linux_)${stable_online_version}.tar.xz" | awk '{print $1}')
experimental_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep -E "(factorio_headless_x64_|factorio-headless_linux_)${experimental_online_version}.tar.xz" | awk '{print $1}')
stable_current_version=$(jq 'with_entries(select(contains({value:{tags:["stable"]}}))) | keys | .[0]' buildinfo.json -r)
latest_current_version=$(jq 'with_entries(select(contains({value:{tags:["latest"]}}))) | keys | .[0]' buildinfo.json -r)
echo "stable_online_version=${stable_online_version} experimental_online_version=${experimental_online_version}"