mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-01 22:48:26 +02:00
Compare commits
234 Commits
Author | SHA1 | Date | |
---|---|---|---|
d90f45bd41 | |||
2b201fea5b | |||
b0a64e5939 | |||
ef24dad0bf | |||
69a52f2c19 | |||
902ad53bd3 | |||
bd2af80a52 | |||
de9fb52d48 | |||
c0157e19ee | |||
8e7bca222a | |||
3e7c79ab74 | |||
979326ebf6 | |||
d5ac333364 | |||
e941e9a2c8 | |||
6fece0c9e3 | |||
10d000408c | |||
d59fd0844a | |||
324920cdf8 | |||
2c88f5e982 | |||
26cec3ae93 | |||
7897de5080 | |||
b474afc1b7 | |||
795ec7dc55 | |||
03f171e34c | |||
313faf6fa5 | |||
17109c97c1 | |||
e62f5e799a | |||
47a7b8312f | |||
3cdf39d04b | |||
b840e86d21 | |||
a9047cae58 | |||
bf128afdb4 | |||
f5ffae1cb4 | |||
31b6768882 | |||
41eca9edf6 | |||
86169c9dad | |||
f36e58058b | |||
1a12761739 | |||
7f43739481 | |||
33e33a4db7 | |||
2d54d50951 | |||
86c8270d99 | |||
5109bc1b40 | |||
5e36f8bad8 | |||
d1258008c1 | |||
275faa1fcc | |||
87cf6c051a | |||
3d8cdfcc1d | |||
d3ef74b10d | |||
b41aad4dc6 | |||
24ac45dbce | |||
8286ab58ac | |||
c2d8509aa8 | |||
b94db83033 | |||
cc23bb396e | |||
1b2fdb298f | |||
ab277975ae | |||
80d8866242 | |||
4ec18b2d15 | |||
93a3011cd3 | |||
15cacdc3da | |||
927bcb89a0 | |||
4ceff25fc2 | |||
5d072db9cc | |||
216b225681 | |||
18f3943eaf | |||
2725534b2b | |||
df35d57455 | |||
9adc8ce4bc | |||
6272bb0018 | |||
a989b500b0 | |||
66bef56cd2 | |||
10f891cabf | |||
9a7f01f8bf | |||
877219f9c9 | |||
843bcbff21 | |||
a7786f03ed | |||
754663df49 | |||
9ac04bcff8 | |||
66d4652302 | |||
5ddb9ab472 | |||
9e72f0509a | |||
914b12adf4 | |||
dc3c040d7c | |||
6a9a596cd8 | |||
eb22dac840 | |||
b48bb4c134 | |||
cf5af1aae1 | |||
d7f0fe16d7 | |||
27c1426109 | |||
a86ac6cafe | |||
70e08f10f3 | |||
c28cea29a4 | |||
e21fc20eb2 | |||
c75b7fa830 | |||
387383d3e8 | |||
c6c94ee180 | |||
b2908081b4 | |||
e53c2adc54 | |||
d6da776148 | |||
30e5f6dd2d | |||
b69fe57291 | |||
b99c1044ca | |||
b37af9bf93 | |||
185ee256ff | |||
6020015574 | |||
a520b87fc8 | |||
e3abfbbe9b | |||
6a135a06bc | |||
14fb9ecf35 | |||
ffef5899e9 | |||
4449e13675 | |||
189395d5c8 | |||
4c1ea766f4 | |||
9ce9a63cfc | |||
8d16422fcb | |||
628c7a34aa | |||
eafc933ca5 | |||
0175ddbca9 | |||
d994449808 | |||
4e63b2654e | |||
abe6054b27 | |||
4fc35c3cdb | |||
081b0c244f | |||
a331033196 | |||
1e3d6d7886 | |||
2474da335e | |||
648b81edf8 | |||
25326b9073 | |||
cae2d3b226 | |||
e13768aa12 | |||
78f00b9f17 | |||
aedc8a29a4 | |||
7168f2927c | |||
7b19c3bfa5 | |||
bffa336cb2 | |||
06a76e4156 | |||
107b902191 | |||
9e4888fe8a | |||
aa5e51680f | |||
590adff3a0 | |||
c60794de39 | |||
a871fe689d | |||
739ed46afe | |||
dfa067e2e9 | |||
7113c03076 | |||
2095404c2a | |||
dff6b849f8 | |||
5c616483f6 | |||
856066ccf1 | |||
ce039016e0 | |||
6f20f17472 | |||
44a28d5c70 | |||
f9b2d6bb9f | |||
bb06a73144 | |||
3eed964b32 | |||
0eb64bc190 | |||
9834ca2842 | |||
6b2307635e | |||
6f4f179276 | |||
ebd6da4b97 | |||
8ee7c360c5 | |||
5f7f1f145c | |||
6b58cb1909 | |||
d6d039d4a6 | |||
02d2c449d3 | |||
8091c3a9f9 | |||
cb5bc74e4b | |||
1ce5c5db7e | |||
e2e7cc7798 | |||
487d345480 | |||
7a276adb3c | |||
7a5f3471d6 | |||
eac273e2d6 | |||
768eaac7b2 | |||
67a0420f06 | |||
b2248d1e8c | |||
60a124f22c | |||
76ee77b674 | |||
a6f0b66f9b | |||
596eec12b6 | |||
e30e313a55 | |||
9528901b95 | |||
16c0f35c97 | |||
623cd6ac87 | |||
ca3a66ca2f | |||
bc74c61fc0 | |||
893124cf43 | |||
92130e3b34 | |||
1194fde627 | |||
6ae4c0d569 | |||
11d8626ccd | |||
d1d5e405cb | |||
1c1e374346 | |||
046a632860 | |||
d80ae622fd | |||
07786290c4 | |||
1e5f88ffd9 | |||
672101f0f7 | |||
7b9d0f514e | |||
7e40c62ff6 | |||
37fbaa38cf | |||
b52a39fe03 | |||
4528be2297 | |||
36bb311baa | |||
78289a5930 | |||
250d5e464d | |||
70e61be5b6 | |||
e935200821 | |||
add31ebe53 | |||
8e20e6696b | |||
126669ca7a | |||
67aaa41cd8 | |||
a61f05709e | |||
0b5c4e144a | |||
95c45b7a39 | |||
5dbb82debe | |||
d85de90142 | |||
216ab0a7d5 | |||
e9c698cbc8 | |||
8d0eef4e2c | |||
110a598ca8 | |||
2f0ce132f2 | |||
96eff95f47 | |||
6c5282b855 | |||
d195fdcdfc | |||
d9a5fac17c | |||
4ec6f41635 | |||
eb0a7410eb | |||
01aeb3b1aa | |||
91f28e34a2 | |||
7f9f640eff | |||
2d99b36f7e | |||
5e71044728 |
@ -1,10 +1,11 @@
|
|||||||
FROM frolvlad/alpine-glibc:alpine-3.5
|
FROM frolvlad/alpine-glibc:alpine-3.6
|
||||||
|
|
||||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||||
|
|
||||||
ENV PORT=34197 \
|
ENV PORT=34197 \
|
||||||
VERSION=0.15.17 \
|
RCON_PORT=27015 \
|
||||||
SHA1=631d396ed02cb9a2be9a33662abad84ac7677b03
|
VERSION=0.15.40 \
|
||||||
|
SHA1=f79a975f6b8c0ee87e2fa60f7d1f7133f332c3ec
|
||||||
|
|
||||||
RUN mkdir /opt && \
|
RUN mkdir /opt && \
|
||||||
apk add --update --no-cache tini pwgen && \
|
apk add --update --no-cache tini pwgen && \
|
||||||
@ -13,6 +14,7 @@ RUN mkdir /opt && \
|
|||||||
-o /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
-o /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.xz" | sha1sum -c && \
|
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.xz" | sha1sum -c && \
|
||||||
tar xf /tmp/factorio_headless_x64_$VERSION.tar.xz --directory /opt && \
|
tar xf /tmp/factorio_headless_x64_$VERSION.tar.xz --directory /opt && \
|
||||||
|
chmod -R ugo=rwx /opt/factorio && \
|
||||||
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
ln -s /factorio/saves /opt/factorio/saves && \
|
ln -s /factorio/saves /opt/factorio/saves && \
|
||||||
ln -s /factorio/mods /opt/factorio/mods && \
|
ln -s /factorio/mods /opt/factorio/mods && \
|
||||||
@ -20,7 +22,7 @@ RUN mkdir /opt && \
|
|||||||
|
|
||||||
VOLUME /factorio
|
VOLUME /factorio
|
||||||
|
|
||||||
EXPOSE $PORT/udp 27015/tcp
|
EXPOSE $PORT/udp $RCON_PORT/tcp
|
||||||
|
|
||||||
COPY ./docker-entrypoint.sh /
|
COPY ./docker-entrypoint.sh /
|
||||||
|
|
||||||
|
@ -21,10 +21,15 @@ if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
|||||||
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
|
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
|
||||||
/opt/factorio/bin/x64/factorio \
|
/opt/factorio/bin/x64/factorio \
|
||||||
--create $SAVES/_autosave1.zip \
|
--create $SAVES/_autosave1.zip \
|
||||||
--map-gen-settings $CONFIG/map-gen-settings.json
|
--map-gen-settings $CONFIG/map-gen-settings.json \
|
||||||
|
--map-settings $CONFIG/map-settings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /opt/factorio/bin/x64/factorio \
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
@ -33,6 +38,6 @@ exec /opt/factorio/bin/x64/factorio \
|
|||||||
--server-settings $CONFIG/server-settings.json \
|
--server-settings $CONFIG/server-settings.json \
|
||||||
--server-whitelist $CONFIG/server-whitelist.json \
|
--server-whitelist $CONFIG/server-whitelist.json \
|
||||||
--server-banlist $CONFIG/server-banlist.json \
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
--rcon-port 27015 \
|
--rcon-port $RCON_PORT \
|
||||||
--rcon-password "$(cat $CONFIG/rconpw)" \
|
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||||
--server-id /factorio/config/server-id.json
|
--server-id /factorio/config/server-id.json
|
||||||
|
46
0.16/Dockerfile
Normal file
46
0.16/Dockerfile
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
FROM frolvlad/alpine-glibc:alpine-3.7
|
||||||
|
|
||||||
|
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||||
|
|
||||||
|
ARG USER=factorio
|
||||||
|
ARG GROUP=factorio
|
||||||
|
ARG PUID=845
|
||||||
|
ARG PGID=845
|
||||||
|
|
||||||
|
ENV PORT=34197 \
|
||||||
|
RCON_PORT=27015 \
|
||||||
|
VERSION=0.16.51 \
|
||||||
|
SHA1=127e7ff484ab263b13615d6114013ce0a66ac929 \
|
||||||
|
SAVES=/factorio/saves \
|
||||||
|
CONFIG=/factorio/config \
|
||||||
|
MODS=/factorio/mods \
|
||||||
|
SCENARIOS=/factorio/scenarios \
|
||||||
|
SCRIPTOUTPUT=/factorio/script-output
|
||||||
|
|
||||||
|
RUN mkdir -p /opt /factorio && \
|
||||||
|
apk add --update --no-cache pwgen && \
|
||||||
|
apk add --update --no-cache --virtual .build-deps curl && \
|
||||||
|
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
||||||
|
-o /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
|
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.xz" | sha1sum -c && \
|
||||||
|
tar xf /tmp/factorio_headless_x64_$VERSION.tar.xz --directory /opt && \
|
||||||
|
chmod ugo=rwx /opt/factorio && \
|
||||||
|
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
|
ln -s $SAVES /opt/factorio/saves && \
|
||||||
|
ln -s $MODS /opt/factorio/mods && \
|
||||||
|
ln -s $SCENARIOS /opt/factorio/scenarios && \
|
||||||
|
ln -s $SCRIPTOUTPUT /opt/factorio/script-output && \
|
||||||
|
apk del .build-deps && \
|
||||||
|
addgroup -g $PGID -S $GROUP && \
|
||||||
|
adduser -u $PUID -G $GROUP -s /bin/sh -SDH $USER && \
|
||||||
|
chown -R $USER:$GROUP /opt/factorio /factorio
|
||||||
|
|
||||||
|
VOLUME /factorio
|
||||||
|
|
||||||
|
EXPOSE $PORT/udp $RCON_PORT/tcp
|
||||||
|
|
||||||
|
COPY files/ /
|
||||||
|
|
||||||
|
USER $USER
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
9
0.16/docker-compose.yml
Normal file
9
0.16/docker-compose.yml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
factorio:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "34197:34197/udp"
|
||||||
|
- "27015:27015/tcp"
|
||||||
|
volumes:
|
||||||
|
- /opt/factorio:/factorio
|
48
0.16/files/docker-entrypoint.sh
Executable file
48
0.16/files/docker-entrypoint.sh
Executable file
@ -0,0 +1,48 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
mkdir -p $SAVES
|
||||||
|
mkdir -p $CONFIG
|
||||||
|
mkdir -p $MODS
|
||||||
|
mkdir -p $SCENARIOS
|
||||||
|
mkdir -p $SCRIPTOUTPUT
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/rconpw ]; then
|
||||||
|
echo $(pwgen 15 1) > $CONFIG/rconpw
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/server-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if find -L $SAVES -iname \*.tmp.zip -mindepth 1 -print | grep -q .; then
|
||||||
|
rm -f $SAVES/*.tmp.zip
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
|
||||||
|
/opt/factorio/bin/x64/factorio \
|
||||||
|
--create $SAVES/_autosave1.zip \
|
||||||
|
--map-gen-settings $CONFIG/map-gen-settings.json \
|
||||||
|
--map-settings $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
|
--port $PORT \
|
||||||
|
--start-server-load-latest \
|
||||||
|
--server-settings $CONFIG/server-settings.json \
|
||||||
|
--server-whitelist $CONFIG/server-whitelist.json \
|
||||||
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
|
--rcon-port $RCON_PORT \
|
||||||
|
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||||
|
--server-id /factorio/config/server-id.json \
|
||||||
|
$@
|
44
0.16/files/scenario.sh
Executable file
44
0.16/files/scenario.sh
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "No argument supplied"
|
||||||
|
fi
|
||||||
|
SCENARIO=$1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
mkdir -p $SAVES
|
||||||
|
mkdir -p $CONFIG
|
||||||
|
mkdir -p $MODS
|
||||||
|
mkdir -p $SCENARIOS
|
||||||
|
|
||||||
|
#chown -R factorio /factorio
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/rconpw ]; then
|
||||||
|
echo $(pwgen 15 1) > $CONFIG/rconpw
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/server-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
|
--port $PORT \
|
||||||
|
--start-server-load-scenario $SCENARIO \
|
||||||
|
--server-settings $CONFIG/server-settings.json \
|
||||||
|
--server-whitelist $CONFIG/server-whitelist.json \
|
||||||
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
|
--rcon-port $RCON_PORT \
|
||||||
|
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||||
|
--server-id /factorio/config/server-id.json
|
30
0.16/files/scenario2map.sh
Executable file
30
0.16/files/scenario2map.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "No argument supplied"
|
||||||
|
fi
|
||||||
|
SCENARIO=$1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
mkdir -p $SAVES
|
||||||
|
mkdir -p $CONFIG
|
||||||
|
mkdir -p $MODS
|
||||||
|
mkdir -p $SCENARIOS
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/server-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
|
--scenario2map $SCENARIO
|
44
0.17/Dockerfile
Normal file
44
0.17/Dockerfile
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
FROM frolvlad/alpine-glibc:alpine-3.9
|
||||||
|
|
||||||
|
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||||
|
|
||||||
|
ARG USER=factorio
|
||||||
|
ARG GROUP=factorio
|
||||||
|
ARG PUID=845
|
||||||
|
ARG PGID=845
|
||||||
|
|
||||||
|
ENV PORT=34197 \
|
||||||
|
RCON_PORT=27015 \
|
||||||
|
VERSION=0.17.4 \
|
||||||
|
SHA1=30a7387e0450ecda8a48a9b56b18058c3f8a9f69 \
|
||||||
|
SAVES=/factorio/saves \
|
||||||
|
CONFIG=/factorio/config \
|
||||||
|
MODS=/factorio/mods \
|
||||||
|
SCENARIOS=/factorio/scenarios \
|
||||||
|
SCRIPTOUTPUT=/factorio/script-output
|
||||||
|
|
||||||
|
RUN mkdir -p /opt /factorio && \
|
||||||
|
apk add --update --no-cache pwgen su-exec binutils && \
|
||||||
|
apk add --update --no-cache --virtual .build-deps curl && \
|
||||||
|
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
||||||
|
-o /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
|
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.xz" | sha1sum -c && \
|
||||||
|
tar xf /tmp/factorio_headless_x64_$VERSION.tar.xz --directory /opt && \
|
||||||
|
chmod ugo=rwx /opt/factorio && \
|
||||||
|
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
|
ln -s $SAVES /opt/factorio/saves && \
|
||||||
|
ln -s $MODS /opt/factorio/mods && \
|
||||||
|
ln -s $SCENARIOS /opt/factorio/scenarios && \
|
||||||
|
ln -s $SCRIPTOUTPUT /opt/factorio/script-output && \
|
||||||
|
apk del .build-deps && \
|
||||||
|
addgroup -g $PGID -S $GROUP && \
|
||||||
|
adduser -u $PUID -G $GROUP -s /bin/sh -SDH $USER && \
|
||||||
|
chown -R $USER:$GROUP /opt/factorio /factorio
|
||||||
|
|
||||||
|
VOLUME /factorio
|
||||||
|
|
||||||
|
EXPOSE $PORT/udp $RCON_PORT/tcp
|
||||||
|
|
||||||
|
COPY files/ /
|
||||||
|
|
||||||
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
11
0.17/docker-compose.yml
Normal file
11
0.17/docker-compose.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
factorio:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "34197:34197/udp"
|
||||||
|
- "27015:27015/tcp"
|
||||||
|
volumes:
|
||||||
|
- /opt/factorio:/factorio
|
||||||
|
# user: 845:845
|
||||||
|
# user: 1000:1000
|
68
0.17/files/docker-entrypoint.sh
Executable file
68
0.17/files/docker-entrypoint.sh
Executable file
@ -0,0 +1,68 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
FACTORIO_VOL=/factorio
|
||||||
|
mkdir -p $FACTORIO_VOL
|
||||||
|
mkdir -p $SAVES
|
||||||
|
mkdir -p $CONFIG
|
||||||
|
mkdir -p $MODS
|
||||||
|
mkdir -p $SCENARIOS
|
||||||
|
mkdir -p $SCRIPTOUTPUT
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/rconpw ]; then
|
||||||
|
# Generate a new RCON password if none exists
|
||||||
|
echo $(pwgen 15 1) > $CONFIG/rconpw
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/server-settings.json ]; then
|
||||||
|
# Copy default settings if server-settings.json doesn't exist
|
||||||
|
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
|
echo "{}" > $CONFIG/map-gen-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if find -L $SAVES -iname \*.tmp.zip -mindepth 1 -print | grep -q .; then
|
||||||
|
# Delete incomplete saves (such as after a forced exit)
|
||||||
|
rm -f $SAVES/*.tmp.zip
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$(id -u)" = '0' ]; then
|
||||||
|
# Take ownership of factorio data if running as root
|
||||||
|
chown -R factorio:factorio $FACTORIO_VOL
|
||||||
|
# Make sure we own temp
|
||||||
|
#mkdir -p /opt/factorio/temp
|
||||||
|
#chown -R factorio:factorio /opt/factorio/temp
|
||||||
|
# Drop to the factorio user
|
||||||
|
SU_EXEC="su-exec factorio"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
|
||||||
|
# Generate a new map if no save ZIPs exist
|
||||||
|
${SU_EXEC} /opt/factorio/bin/x64/factorio \
|
||||||
|
--create $SAVES/_autosave1.zip \
|
||||||
|
--map-gen-settings $CONFIG/map-gen-settings.json \
|
||||||
|
--map-settings $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec ${SU_EXEC} /opt/factorio/bin/x64/factorio \
|
||||||
|
--port $PORT \
|
||||||
|
--start-server-load-latest \
|
||||||
|
--server-settings $CONFIG/server-settings.json \
|
||||||
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
|
--rcon-port $RCON_PORT \
|
||||||
|
--server-whitelist $CONFIG/server-whitelist.json \
|
||||||
|
--use-server-whitelist \
|
||||||
|
--server-adminlist $CONFIG/server-adminlist.json \
|
||||||
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
|
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||||
|
--server-id /factorio/config/server-id.json \
|
||||||
|
"$@"
|
44
0.17/files/scenario.sh
Executable file
44
0.17/files/scenario.sh
Executable file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "No argument supplied"
|
||||||
|
fi
|
||||||
|
SCENARIO=$1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
mkdir -p $SAVES
|
||||||
|
mkdir -p $CONFIG
|
||||||
|
mkdir -p $MODS
|
||||||
|
mkdir -p $SCENARIOS
|
||||||
|
|
||||||
|
#chown -R factorio /factorio
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/rconpw ]; then
|
||||||
|
echo $(pwgen 15 1) > $CONFIG/rconpw
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/server-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
|
--port $PORT \
|
||||||
|
--start-server-load-scenario $SCENARIO \
|
||||||
|
--server-settings $CONFIG/server-settings.json \
|
||||||
|
--server-whitelist $CONFIG/server-whitelist.json \
|
||||||
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
|
--rcon-port $RCON_PORT \
|
||||||
|
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||||
|
--server-id /factorio/config/server-id.json
|
30
0.17/files/scenario2map.sh
Executable file
30
0.17/files/scenario2map.sh
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh -x
|
||||||
|
if [ -z "$1" ]
|
||||||
|
then
|
||||||
|
echo "No argument supplied"
|
||||||
|
fi
|
||||||
|
SCENARIO=$1
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
id
|
||||||
|
|
||||||
|
mkdir -p $SAVES
|
||||||
|
mkdir -p $CONFIG
|
||||||
|
mkdir -p $MODS
|
||||||
|
mkdir -p $SCENARIOS
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/server-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-gen-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f $CONFIG/map-settings.json ]; then
|
||||||
|
cp /opt/factorio/data/map-settings.example.json $CONFIG/map-settings.json
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
|
--scenario2map $SCENARIO
|
159
README.md
159
README.md
@ -1,14 +1,16 @@
|
|||||||
# Factorio [](https://microbadger.com/images/dtandersen/factorio "Get your own image badge on microbadger.com") [](https://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
# Factorio [](https://microbadger.com/images/dtandersen/factorio "Get your own image badge on microbadger.com") [](https://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
||||||
|
|
||||||
* `0.15.17`, `0.15`, `latest` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
* `0.17.4`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.17/Dockerfile)
|
||||||
* `0.14.23`, `0.14`, `stable` [(0.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.14/Dockerfile)
|
* `0.16.51`, `0.16`, `stable` [(0.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/Dockerfile)
|
||||||
|
* `0.15.40`, `0.15` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
||||||
|
* `0.14.23`, `0.14` [(0.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.14/Dockerfile)
|
||||||
* `0.13.20`, `0.13` [(0.13/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.13/Dockerfile)
|
* `0.13.20`, `0.13` [(0.13/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.13/Dockerfile)
|
||||||
|
|
||||||
*Tag descriptions*
|
*Tag descriptions*
|
||||||
|
|
||||||
* `latest` - highest version: may be experimental.
|
* `latest` - most up-to-date version (may be experimental).
|
||||||
* `stable` - highest version declared stable.
|
* `stable` - version declared stable on [factorio.com](https://www.factorio.com).
|
||||||
* `0.x` - highest version in a branch: may be experimental.
|
* `0.x` - latest version in a branch.
|
||||||
* `0.x.y` - a specific version.
|
* `0.x.y` - a specific version.
|
||||||
* `0.x-dev` - whatever is in master for that version.
|
* `0.x-dev` - whatever is in master for that version.
|
||||||
|
|
||||||
@ -28,13 +30,17 @@ NOTE: This is only the server. The game is available at [factorio.com](https://w
|
|||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
Run the server to create the necessary folder structure and configuration files. For this example data is stored in `/tmp/factorio`.
|
Run the server to create the necessary folder structure and configuration files. For this example data is stored in `/opt/factorio`.
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -d -p 34197:34197/udp -p 27015:27015/tcp \
|
sudo mkdir -p /opt/factorio
|
||||||
-v /tmp/factorio:/factorio \
|
sudo chown 845:845 /opt/factorio
|
||||||
|
sudo docker run -d \
|
||||||
|
-p 34197:34197/udp \
|
||||||
|
-p 27015:27015/tcp \
|
||||||
|
-v /opt/factorio:/factorio \
|
||||||
--name factorio \
|
--name factorio \
|
||||||
--restart=always \
|
--restart=always \
|
||||||
dtandersen/factorio
|
dtandersen/factorio
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -42,10 +48,12 @@ For those new to Docker, here is an explanation of the options:
|
|||||||
|
|
||||||
* `-d` - Run as a daemon ("detached").
|
* `-d` - Run as a daemon ("detached").
|
||||||
* `-p` - Expose ports.
|
* `-p` - Expose ports.
|
||||||
* `-v` - Mount `/tmp/factorio` on the local file system to `/factorio` in the container.
|
* `-v` - Mount `/opt/factorio` on the local file system to `/factorio` in the container.
|
||||||
* `--restart` - Restart the server if it crashes and at system start
|
* `--restart` - Restart the server if it crashes and at system start
|
||||||
* `--name` - Name the container "factorio" (otherwise it has a funny random name).
|
* `--name` - Name the container "factorio" (otherwise it has a funny random name).
|
||||||
|
|
||||||
|
The `chown` command is needed because in 0.16+, we no longer run the game server as root for security reasons, but rather as a 'factorio' user with user id 845. The host must therefore allow these files to be written by that user.
|
||||||
|
|
||||||
Check the logs to see what happened:
|
Check the logs to see what happened:
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -58,7 +66,7 @@ Stop the server:
|
|||||||
docker stop factorio
|
docker stop factorio
|
||||||
```
|
```
|
||||||
|
|
||||||
Now there's a `server-settings.json` file in the folder `/tmp/factorio/config`. Modify this to your liking and restart the server:
|
Now there's a `server-settings.json` file in the folder `/opt/factorio/config`. Modify this to your liking and restart the server:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker start factorio
|
docker start factorio
|
||||||
@ -94,7 +102,7 @@ Now run the server as before. In about a minute the new version of Factorio shou
|
|||||||
|
|
||||||
## Saves
|
## Saves
|
||||||
|
|
||||||
A new map named `_autosave1.zip` is generated the first time the server is started. The `map-gen-settings.json` file in `/tmp/factorio/config` is used for the map settings. On subsequent runs the newest save is used.
|
A new map named `_autosave1.zip` is generated the first time the server is started. The `map-gen-settings.json` and `map-settings.json` files in `/opt/factorio/config` are used for the map settings. On subsequent runs the newest save is used.
|
||||||
|
|
||||||
To load an old save stop the server and run the command `touch oldsave.zip`. This resets the date. Then restart the server. Another option is to delete all saves except one.
|
To load an old save stop the server and run the command `touch oldsave.zip`. This resets the date. Then restart the server. Another option is to delete all saves except one.
|
||||||
|
|
||||||
@ -106,6 +114,38 @@ To generate a new map stop the server, delete all of the saves and restart the s
|
|||||||
Copy mods into the mods folder and restart the server.
|
Copy mods into the mods folder and restart the server.
|
||||||
|
|
||||||
|
|
||||||
|
## Scenarios
|
||||||
|
|
||||||
|
If you want to launch a scenario from a clean start (not from a saved map) you'll need to start the docker image from an alternate entrypoint. To do this, use the example entrypoint file stored in the /factorio/entrypoints directory in the volume, and launch the image with the following syntax. Note that this is the normal syntax with the addition of the --entrypoint setting AND the additional argument at the end, which is the name of the Scenario in the Scenarios folder.
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -d \
|
||||||
|
-p 34197:34197/udp \
|
||||||
|
-p 27015:27015/tcp \
|
||||||
|
-v /opt/factorio:/factorio \
|
||||||
|
--name factorio \
|
||||||
|
--restart=always \
|
||||||
|
--entrypoint "/scenario.sh" \
|
||||||
|
dtandersen/factorio \
|
||||||
|
MyScenarioName
|
||||||
|
```
|
||||||
|
|
||||||
|
## Converting Scenarios to Regular Maps
|
||||||
|
|
||||||
|
If you would like to export your scenario to a saved map, you can use the example entrypoint similar to the Scenario usag above. Factorio will run once, converting the Scenario to a saved Map in your saves directory. A restart of the docker image using the standard options will then load that map, just as if the scenario were just started by the Scenarios example noted above.
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -d \
|
||||||
|
-p 34197:34197/udp \
|
||||||
|
-p 27015:27015/tcp \
|
||||||
|
-v /opt/factorio:/factorio \
|
||||||
|
--name factorio \
|
||||||
|
--restart=always \
|
||||||
|
--entrypoint "/scenario2map.sh" \
|
||||||
|
dtandersen/factorio
|
||||||
|
MyScenarioName
|
||||||
|
```
|
||||||
|
|
||||||
## RCON
|
## RCON
|
||||||
|
|
||||||
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
|
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
|
||||||
@ -124,6 +164,24 @@ Create file `config/server-whitelist.json` and add the whitelisted users.
|
|||||||
"friend"
|
"friend"
|
||||||
]
|
]
|
||||||
|
|
||||||
|
## Banlisting (0.17.1+)
|
||||||
|
|
||||||
|
Create file `config/server-banlist.json` and add the banlisted users.
|
||||||
|
|
||||||
|
[
|
||||||
|
"bad_person",
|
||||||
|
"other_bad_person"
|
||||||
|
]
|
||||||
|
|
||||||
|
## Adminlisting (0.17.1+)
|
||||||
|
|
||||||
|
Create file `config/server-adminlist.json` and add the adminlisted users.
|
||||||
|
|
||||||
|
[
|
||||||
|
"you",
|
||||||
|
"friend"
|
||||||
|
]
|
||||||
|
|
||||||
# Container Details
|
# Container Details
|
||||||
|
|
||||||
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
||||||
@ -137,10 +195,15 @@ The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
|||||||
|
|
||||||
To keep things simple, the container uses a single volume mounted at `/factorio`. This volume stores configuration, mods, and saves.
|
To keep things simple, the container uses a single volume mounted at `/factorio`. This volume stores configuration, mods, and saves.
|
||||||
|
|
||||||
|
The files in this volume should be owned by the factorio user, uid 845.
|
||||||
|
|
||||||
factorio
|
factorio
|
||||||
|-- config
|
|-- config
|
||||||
| |-- map-gen-settings.json
|
| |-- map-gen-settings.json
|
||||||
|
| |-- map-settings.json
|
||||||
| |-- rconpw
|
| |-- rconpw
|
||||||
|
| |-- server-adminlist.json
|
||||||
|
| |-- server-banlist.json
|
||||||
| |-- server-settings.json
|
| |-- server-settings.json
|
||||||
| `-- server-whitelist.json
|
| `-- server-whitelist.json
|
||||||
|-- mods
|
|-- mods
|
||||||
@ -148,6 +211,39 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|||||||
`-- saves
|
`-- saves
|
||||||
`-- _autosave1.zip
|
`-- _autosave1.zip
|
||||||
|
|
||||||
|
## Docker Compose
|
||||||
|
|
||||||
|
[Docker Compose](https://docs.docker.com/compose/install/) is an easy way to run Docker containers.
|
||||||
|
|
||||||
|
First get a [docker-compose.yml](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/docker-compose.yml) file. To get it from this repository:
|
||||||
|
|
||||||
|
```
|
||||||
|
git clone https://github.com/dtandersen/docker_factorio_server.git
|
||||||
|
cd docker_factorio_server/0.16
|
||||||
|
```
|
||||||
|
|
||||||
|
Or make your own:
|
||||||
|
|
||||||
|
```
|
||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
factorio:
|
||||||
|
image: dtandersen/factorio
|
||||||
|
ports:
|
||||||
|
- "34197:34197/udp"
|
||||||
|
- "27015:27015/tcp"
|
||||||
|
volumes:
|
||||||
|
- /opt/factorio:/factorio
|
||||||
|
```
|
||||||
|
|
||||||
|
Now cd to the directory with docker-compose.yml and run:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo mkdir -p /opt/factorio
|
||||||
|
sudo chown 845:845 /opt/factorio
|
||||||
|
sudo docker-compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## Ports
|
## Ports
|
||||||
|
|
||||||
@ -158,8 +254,45 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|||||||
## Environment Variables
|
## Environment Variables
|
||||||
|
|
||||||
* `PORT` (0.15+) - Start the server on an alterate port, .e.g. `docker run -e "PORT=34198"`.
|
* `PORT` (0.15+) - Start the server on an alterate port, .e.g. `docker run -e "PORT=34198"`.
|
||||||
|
* `RCON_PORT` (0.16+) - Start the RCON on an alterate port, .e.g. `docker run -e "RCON_PORT=34198"`.
|
||||||
|
|
||||||
|
|
||||||
|
## LAN Games
|
||||||
|
|
||||||
|
Ensure the `lan` setting in server-settings.json is `true`.
|
||||||
|
|
||||||
|
```
|
||||||
|
"visibility":
|
||||||
|
{
|
||||||
|
"public": false,
|
||||||
|
"lan": true
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the container with the `--network=host` option so clients can automatically find LAN games. Refer to the Quick Start to create the `/opt/factorio` directory.
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo docker run -d \
|
||||||
|
--network=host \
|
||||||
|
-p 34197:34197/udp \
|
||||||
|
-p 27015:27015/tcp \
|
||||||
|
-v /opt/factorio:/factorio \
|
||||||
|
--name factorio \
|
||||||
|
--restart=always \
|
||||||
|
dtandersen/factorio
|
||||||
|
```
|
||||||
|
|
||||||
|
## Vagrant
|
||||||
|
|
||||||
|
[Vagrant](https://www.vagrantup.com/) is a easy way to setup a virtual machine (VM) to run Docker. The [Factorio Vagrant box repository](https://github.com/dtandersen/factorio-lan-vagrant) contains a sample Vagrantfile.
|
||||||
|
|
||||||
|
For LAN games the VM needs an internal IP in order for clients to connect. One way to do this is with a public network. The VM uses DHCP to acquire an IP address. The VM must also forward port 34197.
|
||||||
|
|
||||||
|
```
|
||||||
|
config.vm.network "public_network"
|
||||||
|
config.vm.network "forwarded_port", guest: 34197, host: 34197
|
||||||
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
**My server is listed in the server browser, but nobody can connect**
|
**My server is listed in the server browser, but nobody can connect**
|
||||||
@ -178,7 +311,9 @@ Use the `PORT` environment variable to start the server on the a different port,
|
|||||||
# Contributors
|
# Contributors
|
||||||
|
|
||||||
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
|
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
|
||||||
|
* [Fank](https://github.com/Fankserver/docker-factorio-watchdog) - Keeper of the Factorio watchdog that keeps the version up-to-date.
|
||||||
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Originator
|
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Originator
|
||||||
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Randomly generate RCON password
|
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Randomly generate RCON password
|
||||||
* [gnomus](https://github.com/gnomus/docker_factorio_server) - White listing
|
* [gnomus](https://github.com/gnomus/docker_factorio_server) - White listing
|
||||||
|
* [bplein](https://github.com/bplein/docker_factorio_server) - Scenario support
|
||||||
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Version update
|
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Version update
|
||||||
|
Reference in New Issue
Block a user