Compare commits

...

12 Commits

Author SHA1 Message Date
da49c13bb7 Fixed tag match in update
Took 38 minutes
2024-10-22 07:37:00 +02:00
a8ecb01f4c Bump peter-evans/dockerhub-description from 2.4.1 to 4.0.0 (#512)
Bumps [peter-evans/dockerhub-description](https://github.com/peter-evans/dockerhub-description) from 2.4.1 to 4.0.0.
- [Release notes](https://github.com/peter-evans/dockerhub-description/releases)
- [Commits](https://github.com/peter-evans/dockerhub-description/compare/v2.4.1...v4.0.0)

---
updated-dependencies:
- dependency-name: peter-evans/dockerhub-description
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 06:48:30 +02:00
6692bb514d Bump actions/checkout from 2 to 4 (#513)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-22 06:48:03 +02:00
2d805feb4f Cleanup github workflows
Took 9 minutes
2024-10-22 06:46:18 +02:00
bc2dc44cad Removed old 2.0.7 release
Related #511
2024-10-22 06:35:03 +02:00
04085ef23d Auto Update Factorio to stable version: 2.0.8 experimental version: 2.0.8 2024-10-21 21:20:17 +00:00
fbb787e535 Auto Update Factorio to stable version: 2.0.7 experimental version: 2.0.8 2024-10-21 18:30:01 +00:00
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
c269289a96 Improve image stages (#509)
Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
2024-10-21 15:59:34 +02:00
ee0388e163 Auto Update Factorio to stable version: 2.0.7 experimental version: 2.0.7 2024-10-21 12:52:02 +00:00
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
890489fb15 Auto Update Factorio to stable version: 2.0.7 experimental version: 2.0.7 2024-10-21 11:14:31 +00:00
12 changed files with 85 additions and 73 deletions

View File

@ -1,7 +1,11 @@
version: 2 version: 2
updates: updates:
- package-ecosystem: docker - package-ecosystem: "github-actions"
directory: "/docker" directory: "/"
schedule: schedule:
interval: daily interval: "daily"
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/docker"
schedule:
interval: "daily"

View File

@ -4,19 +4,25 @@ on:
push: push:
branches: branches:
- master - master
tags:
- latest
pull_request:
jobs: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@v3
- name: build and push - name: build and push
if: ${{ env.DOCKER_USERNAME != '' && env.DOCKER_PASSWORD != '' }} if: ${{ env.DOCKER_USERNAME != '' && env.DOCKER_PASSWORD != '' }}
env: env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: | run: |
./build.py --push-tags --multiarch ./build.py --push-tags --multiarch

View File

@ -10,9 +10,10 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
- name: Docker Hub Description - name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2.4.1 uses: peter-evans/dockerhub-description@v4.0.0
if: ${{ env.DOCKER_USERNAME != '' && env.DOCKER_PASSWORD != '' }} if: ${{ env.DOCKER_USERNAME != '' && env.DOCKER_PASSWORD != '' }}
env: env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

View File

@ -1,22 +0,0 @@
name: Docker build
on:
pull_request:
push:
tags:
- latest
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: build
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
./build.py --multiarch

View File

@ -10,7 +10,9 @@ jobs:
shellcheck: shellcheck:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout
uses: actions/checkout@v4
- name: shellcheck - name: shellcheck
uses: reviewdog/action-shellcheck@v1 uses: reviewdog/action-shellcheck@v1
with: with:
@ -20,7 +22,9 @@ jobs:
hadolint: hadolint:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Checkout
uses: actions/checkout@v4
- name: hadolint - name: hadolint
uses: reviewdog/action-hadolint@v1 uses: reviewdog/action-hadolint@v1
with: with:

View File

@ -4,20 +4,15 @@ on:
schedule: schedule:
- cron: "0 * * * *" - cron: "0 * * * *"
workflow_dispatch: workflow_dispatch:
inputs:
desc:
description: "desc"
required: false
jobs: jobs:
build: check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'factoriotools/factorio-docker') if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository == 'factoriotools/factorio-docker')
steps: steps:
- uses: actions/checkout@v3 - name: Checkout
with: uses: actions/checkout@v4
token: ${{ secrets.REPO_TOKEN }}
- name: Run update script - name: Run update script
run: ./update.sh run: ./update.sh

View File

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

View File

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

View File

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

View File

@ -16,19 +16,11 @@ ARG BOX64_VERSION=v0.2.4
# space-exploration # space-exploration
ARG PRESET 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 # number of retries that curl will use when pulling the headless server tarball
ARG CURL_RETRIES=8 ARG CURL_RETRIES=8
ENV PORT=34197 \ ENV PORT=34197 \
RCON_PORT=27015 \ RCON_PORT=27015 \
VERSION=${VERSION} \
SHA256=${SHA256} \
SAVES=/factorio/saves \ SAVES=/factorio/saves \
PRESET="$PRESET" \ PRESET="$PRESET" \
CONFIG=/factorio/config \ CONFIG=/factorio/config \
@ -39,6 +31,31 @@ ENV PORT=34197 \
PGID="$PGID" PGID="$PGID"
SHELL ["/bin/bash", "-eo", "pipefail", "-c"] 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 \ RUN set -ox pipefail \
&& if [[ "${VERSION}" == "" ]]; then \ && if [[ "${VERSION}" == "" ]]; then \
echo "build-arg VERSION is required" \ echo "build-arg VERSION is required" \
@ -50,28 +67,15 @@ RUN set -ox pipefail \
fi \ fi \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \ && archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \ && mkdir -p /opt /factorio \
&& apt-get -q update \ && curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" --retry $CURL_RETRIES \
&& 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\
&& echo "$SHA256 $archive" | sha256sum -c \ && echo "$SHA256 $archive" | sha256sum -c \
|| (sha256sum "$archive" && file "$archive" && exit 1) \ || (sha256sum "$archive" && file "$archive" && exit 1) \
&& tar xf "$archive" --directory /opt \ && tar xf "$archive" --directory /opt \
&& chmod ugo=rwx /opt/factorio \ && chmod ugo=rwx /opt/factorio \
&& rm "$archive" \ && 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 "$SCENARIOS" /opt/factorio/scenarios \
&& ln -s "$SAVES" /opt/factorio/saves \ && ln -s "$SAVES" /opt/factorio/saves \
&& mkdir -p /opt/factorio/config/ \ && 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 && chown -R "$USER":"$GROUP" /opt/factorio /factorio
COPY files/*.sh / COPY files/*.sh /

View File

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

View File

@ -4,12 +4,16 @@ 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) 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) 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}')
stable_current_version=$(jq 'with_entries(select(contains({value:{tags:["stable"]}}))) | keys | .[0]' buildinfo.json -r) experimental_sha256=$(curl "https://factorio.com/download/sha256sums/" | grep -E "(factorio_headless_x64_|factorio-headless_linux_)${experimental_online_version}.tar.xz" | awk '{print $1}')
latest_current_version=$(jq 'with_entries(select(contains({value:{tags:["latest"]}}))) | keys | .[0]' buildinfo.json -r)
stable_current_version=$(jq 'with_entries(select(.value.tags | index("stable"))) | keys | .[0]' buildinfo.json -r)
latest_current_version=$(jq 'with_entries(select(.value.tags | index("latest"))) | keys | .[0]' buildinfo.json -r)
echo "stable_online_version=${stable_online_version} experimental_online_version=${experimental_online_version}" echo "stable_online_version=${stable_online_version} experimental_online_version=${experimental_online_version}"
echo "stable_current_version=${stable_current_version} latest_current_version=${latest_current_version}" echo "stable_current_version=${stable_current_version} latest_current_version=${latest_current_version}"
if [[ -z "${stable_online_version}" ]] || [[ -z "${experimental_online_version}" ]]; then if [[ -z "${stable_online_version}" ]] || [[ -z "${experimental_online_version}" ]]; then
exit exit
fi fi
@ -57,6 +61,11 @@ echo "stableCurrentVersionShort=${stableCurrentVersionShort} latestCurrentVersio
tmpfile=$(mktemp) tmpfile=$(mktemp)
# Remove stable tag
cp buildinfo.json "$tmpfile"
jq --arg stable_current_version "$stable_current_version" 'with_entries(if .key == $stable_current_version then .value.tags |= . - ["stable"] else . end)' "$tmpfile" > buildinfo.json
rm -f -- "$tmpfile"
# Remove latest tag # Remove latest tag
cp buildinfo.json "$tmpfile" cp buildinfo.json "$tmpfile"
jq --arg latest_current_version "$latest_current_version" 'with_entries(if .key == $latest_current_version then .value.tags |= . - ["latest"] else . end)' "$tmpfile" > buildinfo.json jq --arg latest_current_version "$latest_current_version" 'with_entries(if .key == $latest_current_version then .value.tags |= . - ["latest"] else . end)' "$tmpfile" > buildinfo.json