mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-10-21 13:19:15 +02:00
Compare commits
12 Commits
add-permis
...
fix-arm64-
Author | SHA1 | Date | |
---|---|---|---|
|
17ec12cb7f | ||
|
b8ad6e06ab | ||
|
89183f5271 | ||
|
4e0c2d0fe9 | ||
|
19ca8d8ceb | ||
|
15bc6ef848 | ||
|
bca045c3d1 | ||
|
b0c8562021 | ||
|
2fe6a0b3c7 | ||
|
b8cd293fdd | ||
|
bd774f0ad8 | ||
|
b3099102cf |
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
2
.github/workflows/docker-description.yml
vendored
2
.github/workflows/docker-description.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Docker Hub Description
|
- name: Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v4.0.2
|
uses: peter-evans/dockerhub-description@v4.0.2
|
||||||
|
4
.github/workflows/lint.yml
vendored
4
.github/workflows/lint.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: shellcheck
|
- name: shellcheck
|
||||||
uses: reviewdog/action-shellcheck@v1
|
uses: reviewdog/action-shellcheck@v1
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: hadolint
|
- name: hadolint
|
||||||
uses: reviewdog/action-hadolint@v1
|
uses: reviewdog/action-hadolint@v1
|
||||||
|
2
.github/workflows/update.yml
vendored
2
.github/workflows/update.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.REPO_TOKEN }}
|
token: ${{ secrets.REPO_TOKEN }}
|
||||||
|
|
||||||
|
13
README.md
13
README.md
@@ -6,17 +6,8 @@
|
|||||||
[中文](./README_zh_CN.md)
|
[中文](./README_zh_CN.md)
|
||||||
|
|
||||||
<!-- start autogeneration tags -->
|
<!-- start autogeneration tags -->
|
||||||
* `latest, 2.0.60`
|
* `latest, 2.0.65`
|
||||||
* `2, 2.0, 2.0.55, stable, stable-2.0.55`
|
* `2, 2.0, 2.0.60, stable, stable-2.0.60`
|
||||||
* `2.0.59`
|
|
||||||
* `stable-1.1.110, 1, 1.1, 1.1.110`
|
|
||||||
* `1.0.0, 1.0`
|
|
||||||
* `0.17.79, 0.17`
|
|
||||||
* `0.16.51, 0.16`
|
|
||||||
* `0.15.40, 0.15`
|
|
||||||
* `0.14.23, 0.14`
|
|
||||||
* `0.13.20, 0.13`
|
|
||||||
* `0.12.35, 0.12`
|
|
||||||
<!-- end autogeneration tags -->
|
<!-- end autogeneration tags -->
|
||||||
|
|
||||||
## Tag descriptions
|
## Tag descriptions
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
{
|
{
|
||||||
"2.0.55": {
|
|
||||||
"sha256": "ef12a54d1556ae1f84ff99edc23706d13b7ad41f1c02d74ca1dfadf9448fcbae",
|
|
||||||
"tags": [
|
|
||||||
"stable",
|
|
||||||
"stable-2.0.55",
|
|
||||||
"2",
|
|
||||||
"2.0",
|
|
||||||
"2.0.55"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"2.0.60": {
|
"2.0.60": {
|
||||||
"sha256": "69b5be1a867fd99524f9914dfee900a1ac386cf4e74c4a63768c05dc4d2b2b0b",
|
"sha256": "69b5be1a867fd99524f9914dfee900a1ac386cf4e74c4a63768c05dc4d2b2b0b",
|
||||||
"tags": [
|
"tags": [
|
||||||
"latest",
|
"stable",
|
||||||
|
"stable-2.0.60",
|
||||||
|
"2",
|
||||||
|
"2.0",
|
||||||
"2.0.60"
|
"2.0.60"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"2.0.65": {
|
||||||
|
"sha256": "6b80f0fbeb43753ed7654695ffa427f442496068f2f72129de76cea246a0c63e",
|
||||||
|
"tags": [
|
||||||
|
"latest",
|
||||||
|
"2.0.65"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -54,8 +54,8 @@ RUN apt-get -q update \
|
|||||||
fi \
|
fi \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
RUN addgroup --system --gid "$PGID" "$GROUP" \
|
RUN groupadd --system --gid "$PGID" "$GROUP" \
|
||||||
&& adduser --system --uid "$PUID" --gid "$PGID" --no-create-home --disabled-password --shell /bin/sh "$USER"
|
&& useradd --system --uid "$PUID" --gid "$PGID" --no-create-home --shell /bin/sh "$USER"
|
||||||
|
|
||||||
# version checksum of the archive to download
|
# version checksum of the archive to download
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
|
@@ -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=2.0.55
|
- VERSION=2.0.60
|
||||||
- SHA256=ef12a54d1556ae1f84ff99edc23706d13b7ad41f1c02d74ca1dfadf9448fcbae
|
- SHA256=69b5be1a867fd99524f9914dfee900a1ac386cf4e74c4a63768c05dc4d2b2b0b
|
||||||
ports:
|
ports:
|
||||||
- "34197:34197/udp"
|
- "34197:34197/udp"
|
||||||
- "27015:27015/tcp"
|
- "27015:27015/tcp"
|
||||||
|
@@ -53,10 +53,9 @@ fi
|
|||||||
# In rootless mode, we don't need to handle user switching or chown
|
# In rootless mode, we don't need to handle user switching or chown
|
||||||
# The container runs as the specified user from the start
|
# The container runs as the specified user from the start
|
||||||
EXEC=""
|
EXEC=""
|
||||||
if [[ -f /bin/box64 ]]; then
|
# Setup ARM64 emulation support
|
||||||
# Use emulator for ARM hosts
|
# shellcheck disable=SC1091
|
||||||
EXEC="/bin/box64"
|
source "${INSTALLED_DIRECTORY}/setup-exec.sh"
|
||||||
fi
|
|
||||||
|
|
||||||
# Update config path
|
# Update config path
|
||||||
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
|
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
|
||||||
|
@@ -41,10 +41,10 @@ if [[ $NRTMPSAVES -gt 0 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
|
if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
|
||||||
${INSTALLED_DIRECTORY}/docker-update-mods.sh
|
"${INSTALLED_DIRECTORY}"/docker-update-mods.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${INSTALLED_DIRECTORY}/docker-dlc.sh
|
"${INSTALLED_DIRECTORY}"/docker-dlc.sh
|
||||||
|
|
||||||
EXEC=""
|
EXEC=""
|
||||||
if [[ $(id -u) == 0 ]]; then
|
if [[ $(id -u) == 0 ]]; then
|
||||||
@@ -56,11 +56,10 @@ if [[ $(id -u) == 0 ]]; then
|
|||||||
# Drop to the factorio user
|
# Drop to the factorio user
|
||||||
EXEC="runuser -u factorio -g factorio --"
|
EXEC="runuser -u factorio -g factorio --"
|
||||||
fi
|
fi
|
||||||
if [[ -f /bin/box64 ]]; then
|
|
||||||
# Use an emulator to run on ARM hosts
|
# Setup ARM64 emulation support
|
||||||
# this only gets installed when the target docker platform is linux/arm64
|
# shellcheck disable=SC1091
|
||||||
EXEC="$EXEC /bin/box64"
|
source "${INSTALLED_DIRECTORY}/setup-exec.sh"
|
||||||
fi
|
|
||||||
|
|
||||||
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
|
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eoux pipefail
|
set -eoux pipefail
|
||||||
|
INSTALLED_DIRECTORY=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
|
||||||
|
|
||||||
if [[ -z ${1:-} ]]; then
|
if [[ -z ${1:-} ]]; then
|
||||||
echo "No argument supplied"
|
echo "No argument supplied"
|
||||||
@@ -31,7 +32,12 @@ if [[ ! -f $CONFIG/map-settings.json ]]; then
|
|||||||
cp /opt/factorio/data/map-settings.example.json "$CONFIG/map-settings.json"
|
cp /opt/factorio/data/map-settings.example.json "$CONFIG/map-settings.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /opt/factorio/bin/x64/factorio \
|
# Setup ARM64 emulation support
|
||||||
|
EXEC=""
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source "${INSTALLED_DIRECTORY}/setup-exec.sh"
|
||||||
|
|
||||||
|
exec $EXEC /opt/factorio/bin/x64/factorio \
|
||||||
--port "$PORT" \
|
--port "$PORT" \
|
||||||
--start-server-load-scenario "$SERVER_SCENARIO" \
|
--start-server-load-scenario "$SERVER_SCENARIO" \
|
||||||
--preset "$PRESET" \
|
--preset "$PRESET" \
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -eoux pipefail
|
set -eoux pipefail
|
||||||
|
INSTALLED_DIRECTORY=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
|
||||||
|
|
||||||
if [[ -z ${1:-} ]]; then
|
if [[ -z ${1:-} ]]; then
|
||||||
echo "No argument supplied"
|
echo "No argument supplied"
|
||||||
@@ -23,5 +24,10 @@ if [[ ! -f $CONFIG/map-settings.json ]]; then
|
|||||||
cp /opt/factorio/data/map-settings.example.json "$CONFIG/map-settings.json"
|
cp /opt/factorio/data/map-settings.example.json "$CONFIG/map-settings.json"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /opt/factorio/bin/x64/factorio \
|
# Setup ARM64 emulation support
|
||||||
|
EXEC=""
|
||||||
|
# shellcheck disable=SC1091
|
||||||
|
source "${INSTALLED_DIRECTORY}/setup-exec.sh"
|
||||||
|
|
||||||
|
exec $EXEC /opt/factorio/bin/x64/factorio \
|
||||||
--scenario2map "$SERVER_SCENARIO"
|
--scenario2map "$SERVER_SCENARIO"
|
||||||
|
16
docker/files/setup-exec.sh
Normal file
16
docker/files/setup-exec.sh
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# Setup EXEC variable for running Factorio with ARM64 emulation support
|
||||||
|
# This script handles ARM64 emulation and can be combined with user switching as needed
|
||||||
|
|
||||||
|
# If EXEC is not already set, initialize it
|
||||||
|
if [[ -z "${EXEC:-}" ]]; then
|
||||||
|
EXEC=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f /bin/box64 ]]; then
|
||||||
|
# Use an emulator to run on ARM hosts
|
||||||
|
# this only gets installed when the target docker platform is linux/arm64
|
||||||
|
EXEC="$EXEC /bin/box64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export EXEC
|
@@ -1,3 +1,4 @@
|
|||||||
|
#define _GNU_SOURCE
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@@ -107,7 +108,8 @@ char* read_password(const char* conf_dir) {
|
|||||||
fseek(fptr, 0, SEEK_SET); /* same as rewind(f); */
|
fseek(fptr, 0, SEEK_SET); /* same as rewind(f); */
|
||||||
|
|
||||||
char *password = malloc(fsize + 1);
|
char *password = malloc(fsize + 1);
|
||||||
fread(password, fsize, 1, fptr);
|
size_t bytes_read = fread(password, fsize, 1, fptr);
|
||||||
|
(void)bytes_read; // Suppress unused warning
|
||||||
fclose(fptr);
|
fclose(fptr);
|
||||||
|
|
||||||
password[fsize] = 0;
|
password[fsize] = 0;
|
||||||
|
Reference in New Issue
Block a user