mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-03 07:28:27 +02:00
Compare commits
156 Commits
Author | SHA1 | Date | |
---|---|---|---|
9fcbb9ba24 | |||
60308b60fc | |||
f170800d8f | |||
4f71f75b72 | |||
d73235ea9e | |||
7ea6fa3274 | |||
a511769e70 | |||
c5f4b8860e | |||
6e92b0f850 | |||
97cf42b229 | |||
007503b7c6 | |||
4b6fc187dc | |||
dc0034f00d | |||
487b0d7bd6 | |||
1c82a0fb65 | |||
6bfeb9dabf | |||
33a9379f9f | |||
35eb0fbfb7 | |||
ff1c0a954e | |||
4280ef8cfc | |||
2cefc1544c | |||
1c07730c4e | |||
cf4d1cb218 | |||
d52709ff0f | |||
7992ded59e | |||
06e168f899 | |||
a3ad4c25a1 | |||
4cde518f36 | |||
616d78c45f | |||
730bb5d604 | |||
f379330b7c | |||
a9bb898fb2 | |||
6c787666a4 | |||
1a4e5df5a7 | |||
52dcbafedb | |||
d88da771e9 | |||
f2c9fbb10c | |||
47d6cfb2b1 | |||
1e97a95302 | |||
3f8621f896 | |||
05a3ca45e4 | |||
fc42bf7863 | |||
1dbac7408f | |||
9261339510 | |||
8e1a044172 | |||
b85b998062 | |||
f3b4d8e445 | |||
4a48f9234f | |||
8d90253929 | |||
aca4709d7f | |||
a2ebf4db2d | |||
bbacd8e67d | |||
eb0d08c3c3 | |||
dc53f6a61f | |||
92d459b14d | |||
ef55d08655 | |||
c5ae7515fe | |||
ec17a32638 | |||
15da4f79f5 | |||
68e8a5f25c | |||
b658982c93 | |||
1d3fc75d20 | |||
a4a482ee91 | |||
eafe7c08be | |||
9acfe47d16 | |||
b47b20e834 | |||
7e0718a332 | |||
ae327add0b | |||
efb5eb7afc | |||
ec1c4f9455 | |||
edf8035ae3 | |||
25b41c9f22 | |||
228339ec31 | |||
755c106b7b | |||
f1f76e9ae0 | |||
26f053451c | |||
c439634ef1 | |||
cc33c84d86 | |||
8806ca2160 | |||
83bf5c4a11 | |||
30859d57b8 | |||
3e9f74eaac | |||
14bbd68a3b | |||
d4052bc790 | |||
2fc2b7656d | |||
199f6c7f59 | |||
d614babc54 | |||
257e1751c2 | |||
e8e5047490 | |||
d089b02941 | |||
6fe77c30da | |||
a97763a0e1 | |||
602881a0d9 | |||
b56ab27e52 | |||
5edbcd9055 | |||
059a77574e | |||
c1488c61be | |||
fb0d7d955b | |||
a34b260d15 | |||
5d5cb71a90 | |||
ad9c5c37dc | |||
63a9eb14d2 | |||
76eddb14f8 | |||
24bd934d98 | |||
9c873ac907 | |||
c44a3d1faf | |||
926a377146 | |||
52bb117a2b | |||
04c4a6b577 | |||
39c27944be | |||
ba9faac10e | |||
c987fe8769 | |||
606b537b13 | |||
9473de8934 | |||
6b00a3fc32 | |||
34a99ec43e | |||
2caf5345c2 | |||
8a68a162fe | |||
96a6f66445 | |||
e5c351dd14 | |||
eedff789a5 | |||
20fcec5783 | |||
2bfa89fea1 | |||
ee99e7d469 | |||
817844352d | |||
abd518de79 | |||
98337ac18f | |||
2bd0d475eb | |||
2d9d8e17b8 | |||
48c22aa707 | |||
97feb7acb5 | |||
5ee0f8d06a | |||
7230263559 | |||
6f65ae8acc | |||
2fae0bdb22 | |||
4f10d32d7b | |||
61e3941a5a | |||
777cac4849 | |||
9a35472d8a | |||
5b3d17117f | |||
234eea09f0 | |||
c5e0b6b3b5 | |||
df19b88ba0 | |||
0a39c756a5 | |||
0cab74d578 | |||
23c26f83ae | |||
3de6931817 | |||
7a370c11e0 | |||
1a09531600 | |||
ea57f58c3b | |||
5eb71608de | |||
51398ca509 | |||
16dc9c9da2 | |||
e30bf8d656 | |||
3cd89b6870 | |||
f33bfadd47 |
@ -1,28 +0,0 @@
|
|||||||
FROM frolvlad/alpine-glibc:alpine-3.4
|
|
||||||
|
|
||||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
|
||||||
|
|
||||||
COPY ./factorio.crt /opt/factorio.crt
|
|
||||||
|
|
||||||
ENV VERSION=0.13.20 \
|
|
||||||
SHA1=59ed0edb3f62f0f41a01fc291959b0a8b44cf631
|
|
||||||
|
|
||||||
RUN apk --no-cache add curl tini pwgen && \
|
|
||||||
curl -sSL --cacert /opt/factorio.crt \
|
|
||||||
https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
|
||||||
-o /tmp/factorio_headless_x64_$VERSION.tar.gz && \
|
|
||||||
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c && \
|
|
||||||
tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz --directory /opt && \
|
|
||||||
rm /tmp/factorio_headless_x64_$VERSION.tar.gz && \
|
|
||||||
apk del curl && \
|
|
||||||
ln -s /factorio/saves /opt/factorio/saves && \
|
|
||||||
ln -s /factorio/mods /opt/factorio/mods
|
|
||||||
|
|
||||||
VOLUME /factorio
|
|
||||||
|
|
||||||
EXPOSE 34197/udp 27015/tcp
|
|
||||||
|
|
||||||
COPY ./docker-entrypoint.sh /
|
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
|
||||||
CMD ["/docker-entrypoint.sh"]
|
|
@ -1 +0,0 @@
|
|||||||
sudo docker build -t dtandersen/factorio:0.13-dev .
|
|
@ -1 +0,0 @@
|
|||||||
sudo rm -rf /tmp/factorio
|
|
@ -1,35 +0,0 @@
|
|||||||
#!/bin/sh -x
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SAVES=/factorio/saves
|
|
||||||
CONFIG=/factorio/config
|
|
||||||
|
|
||||||
mkdir -p $SAVES
|
|
||||||
mkdir -p /factorio/mods
|
|
||||||
mkdir -p $CONFIG
|
|
||||||
|
|
||||||
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 ! 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
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec /opt/factorio/bin/x64/factorio \
|
|
||||||
--port 34197 \
|
|
||||||
--start-server-load-latest \
|
|
||||||
--server-settings $CONFIG/server-settings.json \
|
|
||||||
--rcon-port 27015 \
|
|
||||||
--rcon-password "$(cat $CONFIG/rconpw)"
|
|
@ -1,5 +0,0 @@
|
|||||||
sudo docker run --rm -it \
|
|
||||||
-v /tmp/factorio:/factorio \
|
|
||||||
--name factorio \
|
|
||||||
dtandersen/factorio:0.13-dev "$@"
|
|
||||||
find /tmp/factorio -type f
|
|
@ -2,19 +2,23 @@ FROM frolvlad/alpine-glibc:alpine-3.4
|
|||||||
|
|
||||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||||
|
|
||||||
ENV VERSION=0.14.23 \
|
COPY ./factorio.crt /opt/factorio.crt
|
||||||
SHA1=6ef84341c6fc1cf45cfdd6acc8468aaa117b9e8a
|
|
||||||
|
|
||||||
RUN mkdir /opt && \
|
ENV VERSION=0.14.16 \
|
||||||
apk --no-cache add curl tini pwgen && \
|
SHA1=e27c658bf8a7579b662a1c34815daa223e57bc90
|
||||||
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
|
||||||
|
RUN apk --update --no-cache add bash curl && \
|
||||||
|
curl -sSL --cacert /opt/factorio.crt \
|
||||||
|
https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
||||||
-o /tmp/factorio_headless_x64_$VERSION.tar.gz && \
|
-o /tmp/factorio_headless_x64_$VERSION.tar.gz && \
|
||||||
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c && \
|
echo "$SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c && \
|
||||||
tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz --directory /opt && \
|
tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz --directory /opt && \
|
||||||
rm /tmp/factorio_headless_x64_$VERSION.tar.gz && \
|
rm /tmp/factorio_headless_x64_$VERSION.tar.gz && \
|
||||||
apk del curl && \
|
apk --no-cache del curl && \
|
||||||
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 && \
|
||||||
|
ln -s /factorio/config/server-settings.json /opt/factorio/data/server-settings.json && \
|
||||||
|
ln -s /factorio/config/map-gen-settings.json /opt/factorio/data/map-gen-settings.json
|
||||||
|
|
||||||
VOLUME /factorio
|
VOLUME /factorio
|
||||||
|
|
||||||
@ -22,5 +26,4 @@ EXPOSE 34197/udp 27015/tcp
|
|||||||
|
|
||||||
COPY ./docker-entrypoint.sh /
|
COPY ./docker-entrypoint.sh /
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
|
||||||
CMD ["/docker-entrypoint.sh"]
|
CMD ["/docker-entrypoint.sh"]
|
||||||
|
2
0.14/build.sh
Executable file → Normal file
2
0.14/build.sh
Executable file → Normal file
@ -1 +1 @@
|
|||||||
sudo docker build --no-cache -t factorio .
|
sudo docker build -t factorio .
|
||||||
|
@ -1 +0,0 @@
|
|||||||
sudo rm -rf /tmp/factorio
|
|
29
0.14/docker-entrypoint.sh
Executable file → Normal file
29
0.14/docker-entrypoint.sh
Executable file → Normal file
@ -1,35 +1,28 @@
|
|||||||
#!/bin/sh -x
|
#!/bin/bash -x
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
SAVES=/factorio/saves
|
SAVES=/opt/factorio/saves
|
||||||
CONFIG=/factorio/config
|
|
||||||
|
|
||||||
mkdir -p $SAVES
|
mkdir -p /factorio/saves
|
||||||
mkdir -p /factorio/mods
|
mkdir -p /factorio/mods
|
||||||
mkdir -p $CONFIG
|
mkdir -p /factorio/config
|
||||||
|
|
||||||
if [ ! -f $CONFIG/rconpw ]; then
|
if [ ! -f /factorio/config/server-settings.json ]; then
|
||||||
echo $(pwgen 15 1) > $CONFIG/rconpw
|
cp /opt/factorio/data/server-settings.example.json /factorio/config/server-settings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f $CONFIG/server-settings.json ]; then
|
if [ ! -f /factorio/config/map-gen-settings.json ]; then
|
||||||
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
|
cp /opt/factorio/data/map-gen-settings.example.json /factorio/config/map-gen-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
|
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/save.zip \
|
||||||
--map-gen-settings $CONFIG/map-gen-settings.json
|
--map-gen-settings /opt/factorio/data/map-gen-settings.json
|
||||||
fi
|
fi
|
||||||
|
|
||||||
exec /opt/factorio/bin/x64/factorio \
|
exec /opt/factorio/bin/x64/factorio \
|
||||||
--port 34197 \
|
--port 34197 \
|
||||||
--start-server-load-latest \
|
--start-server-load-latest \
|
||||||
--server-settings $CONFIG/server-settings.json \
|
--server-settings /opt/factorio/data/server-settings.json
|
||||||
--rcon-port 27015 \
|
|
||||||
--rcon-password "$(cat $CONFIG/rconpw)"
|
|
||||||
|
6
0.14/run.sh
Executable file → Normal file
6
0.14/run.sh
Executable file → Normal file
@ -1,5 +1,9 @@
|
|||||||
|
#mkdir -p /tmp/factorio/config
|
||||||
|
#mkdir -p /tmp/factorio/mods
|
||||||
|
#mkdir -p /tmp/factorio/saves
|
||||||
|
#cp -n server-settings.example.json /tmp/factorio/config/server-settings.json
|
||||||
|
#cp -n map-gen-settings.example.json /tmp/factorio/config/map-gen-settings.json
|
||||||
sudo docker run --rm -it \
|
sudo docker run --rm -it \
|
||||||
-v /tmp/factorio:/factorio \
|
-v /tmp/factorio:/factorio \
|
||||||
--name factorio \
|
--name factorio \
|
||||||
factorio "$@"
|
factorio "$@"
|
||||||
find /tmp/factorio -type f
|
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
FROM frolvlad/alpine-glibc:alpine-3.6
|
|
||||||
|
|
||||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
|
||||||
|
|
||||||
ENV PORT=34197 \
|
|
||||||
RCON_PORT=27015 \
|
|
||||||
VERSION=0.15.40 \
|
|
||||||
SHA1=f79a975f6b8c0ee87e2fa60f7d1f7133f332c3ec
|
|
||||||
|
|
||||||
RUN mkdir /opt && \
|
|
||||||
apk add --update --no-cache tini 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 -R ugo=rwx /opt/factorio && \
|
|
||||||
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
|
||||||
ln -s /factorio/saves /opt/factorio/saves && \
|
|
||||||
ln -s /factorio/mods /opt/factorio/mods && \
|
|
||||||
apk del .build-deps
|
|
||||||
|
|
||||||
VOLUME /factorio
|
|
||||||
|
|
||||||
EXPOSE $PORT/udp $RCON_PORT/tcp
|
|
||||||
|
|
||||||
COPY ./docker-entrypoint.sh /
|
|
||||||
|
|
||||||
ENTRYPOINT ["/sbin/tini", "--"]
|
|
||||||
CMD ["/docker-entrypoint.sh"]
|
|
@ -1,8 +0,0 @@
|
|||||||
version: '2'
|
|
||||||
services:
|
|
||||||
factorio:
|
|
||||||
build: .
|
|
||||||
ports:
|
|
||||||
- "34197:34197"
|
|
||||||
volumes:
|
|
||||||
- /tmp/factorio:/factorio
|
|
@ -1,43 +0,0 @@
|
|||||||
#!/bin/sh -x
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
SAVES=/factorio/saves
|
|
||||||
CONFIG=/factorio/config
|
|
||||||
|
|
||||||
mkdir -p $SAVES
|
|
||||||
mkdir -p /factorio/mods
|
|
||||||
mkdir -p $CONFIG
|
|
||||||
|
|
||||||
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 \*.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
|
|
@ -1,49 +0,0 @@
|
|||||||
FROM frolvlad/alpine-glibc:alpine-3.6
|
|
||||||
|
|
||||||
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.1 \
|
|
||||||
SHA1=1247cdb57b8146896f1972c60911fe45119c384b
|
|
||||||
|
|
||||||
VOLUME /factorio
|
|
||||||
|
|
||||||
RUN mkdir -p /opt && \
|
|
||||||
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 -R ugo=rwx /opt/factorio && \
|
|
||||||
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
|
||||||
ln -s /factorio/saves /opt/factorio/saves && \
|
|
||||||
ln -s /factorio/mods /opt/factorio/mods && \
|
|
||||||
apk del .build-deps && \
|
|
||||||
addgroup -g $PGID -S $GROUP && \
|
|
||||||
adduser -u $PUID -G $USER -s /bin/sh -SDH $GROUP && \
|
|
||||||
chown -R $USER:$GROUP /opt/factorio /factorio
|
|
||||||
|
|
||||||
EXPOSE $PORT/udp $RCON_PORT/tcp
|
|
||||||
|
|
||||||
COPY ./docker-entrypoint.sh /
|
|
||||||
|
|
||||||
USER $USER
|
|
||||||
|
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
||||||
CMD ["/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" \
|
|
||||||
]
|
|
@ -1,9 +0,0 @@
|
|||||||
version: '2'
|
|
||||||
services:
|
|
||||||
factorio:
|
|
||||||
build: .
|
|
||||||
ports:
|
|
||||||
- "34197:34197"
|
|
||||||
volumes:
|
|
||||||
- /opt/factorio:/factorio
|
|
||||||
user: 1000:1000
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/sh -x
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
id
|
|
||||||
|
|
||||||
SAVES=/factorio/saves
|
|
||||||
CONFIG=/factorio/config
|
|
||||||
|
|
||||||
mkdir -p $SAVES
|
|
||||||
mkdir -p /factorio/mods
|
|
||||||
mkdir -p $CONFIG
|
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
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 "$@"
|
|
||||||
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
|
|
115
README.md
115
README.md
@ -1,17 +1,6 @@
|
|||||||
# 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://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
||||||
|
|
||||||
* `0.16.1`, `0.16`, `latest` [(0.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/Dockerfile)
|
* `0.14.16`, `0.14`, `latest` [(0.14.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.16/Dockerfile)
|
||||||
* `0.15.40`, `0.15`, `stable` [(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)
|
|
||||||
|
|
||||||
*Tag descriptions*
|
|
||||||
|
|
||||||
* `latest` - highest version: may be experimental.
|
|
||||||
* `stable` - highest version declared stable.
|
|
||||||
* `0.x` - highest version in a branch: may be experimental.
|
|
||||||
* `0.x.y` - a specific version.
|
|
||||||
* `0.x-dev` - whatever is in master for that version.
|
|
||||||
|
|
||||||
|
|
||||||
# What is Factorio?
|
# What is Factorio?
|
||||||
@ -32,19 +21,14 @@ NOTE: This is only the server. The game is available at [factorio.com](https://w
|
|||||||
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 `/tmp/factorio`.
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -d -p 34197:34197/udp -p 27015:27015/tcp \
|
docker run -d -P -v /tmp/factorio:/factorio --name factorio dtandersen/factorio
|
||||||
-v /tmp/factorio:/factorio \
|
|
||||||
--name factorio \
|
|
||||||
--restart=always \
|
|
||||||
dtandersen/factorio
|
|
||||||
```
|
```
|
||||||
|
|
||||||
For those new to Docker, here is an explanation of the options:
|
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 all ports.
|
||||||
* `-v` - Mount `/tmp/factorio` on the local file system to `/factorio` in the container.
|
* `-v` - Mount `/tmp/factorio` on the local file system to `/factorio` in the container.
|
||||||
* `--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).
|
||||||
|
|
||||||
Check the logs to see what happened:
|
Check the logs to see what happened:
|
||||||
@ -68,36 +52,11 @@ docker start factorio
|
|||||||
Try to connect to the server. Check the logs if it isn't working.
|
Try to connect to the server. Check the logs if it isn't working.
|
||||||
|
|
||||||
|
|
||||||
## Console
|
|
||||||
|
|
||||||
To issue console commands to the server, start the server in interactive mode with `-it`. Open the console with `docker attach` and then type commands.
|
|
||||||
|
|
||||||
docker run -d -it \
|
|
||||||
--name factorio \
|
|
||||||
dtandersen/factorio
|
|
||||||
docker attach factorio
|
|
||||||
|
|
||||||
|
|
||||||
## Upgrading
|
|
||||||
|
|
||||||
Before upgrading backup the save. It's easy to make a save in the client.
|
|
||||||
|
|
||||||
Ensure `-v` was used to run the server so the save is outside of the Docker container. The `docker rm` command completely destroys the container, which includes the save if it isn't stored in an data volume.
|
|
||||||
|
|
||||||
Delete the container and refresh the image:
|
|
||||||
|
|
||||||
docker stop factorio
|
|
||||||
docker rm factorio
|
|
||||||
docker pull dtandersen/factorio
|
|
||||||
|
|
||||||
Now run the server as before. In about a minute the new version of Factorio should be up and running, complete with saves and config!
|
|
||||||
|
|
||||||
|
|
||||||
## Saves
|
## Saves
|
||||||
|
|
||||||
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 `/tmp/factorio/config` are used for the map settings. On subsequent runs the newest save is used.
|
A new map named `save.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.
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
To generate a new map stop the server, delete all of the saves and restart the server.
|
To generate a new map stop the server, delete all of the saves and restart the server.
|
||||||
|
|
||||||
@ -107,29 +66,16 @@ 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.
|
||||||
|
|
||||||
|
|
||||||
## RCON
|
## Remote Console
|
||||||
|
|
||||||
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
|
RCON is currently disabled.
|
||||||
|
|
||||||
To change the password, stop the server, modify `rconpw`, and restart the server.
|
|
||||||
|
|
||||||
To "disable" RCON don't expose port 27015, i.e. start the server without `-p 27015:27015/tcp`. RCON is still running, but nobody can to connect to it.
|
|
||||||
|
|
||||||
|
|
||||||
## Whitelisting (0.15.3+)
|
|
||||||
|
|
||||||
Create file `config/server-whitelist.json` and add the whitelisted users.
|
|
||||||
|
|
||||||
[
|
|
||||||
"you",
|
|
||||||
"friend"
|
|
||||||
]
|
|
||||||
|
|
||||||
# Container Details
|
# Container Details
|
||||||
|
|
||||||
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
The philosophy is to keep things simple.
|
||||||
|
|
||||||
* The server should bootstrap itself.
|
* Self-configure to a minimal working state.
|
||||||
* Prefer configuration files over environment variables.
|
* Prefer configuration files over environment variables.
|
||||||
* Use one volume for data.
|
* Use one volume for data.
|
||||||
|
|
||||||
@ -140,46 +86,31 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|||||||
|
|
||||||
factorio
|
factorio
|
||||||
|-- config
|
|-- config
|
||||||
| |-- map-gen-settings.json
|
|
||||||
| |-- rconpw
|
|
||||||
| |-- server-settings.json
|
| |-- server-settings.json
|
||||||
| `-- server-whitelist.json
|
| +-- map-gen-settings.json
|
||||||
|-- mods
|
|-- mods
|
||||||
| `-- fancymod.zip
|
| |-- fancymod.zip
|
||||||
`-- saves
|
+-- saves
|
||||||
`-- _autosave1.zip
|
|-- _autosave1.zip
|
||||||
|
+-- save.zip
|
||||||
|
|
||||||
|
|
||||||
## Ports
|
## Ports
|
||||||
|
|
||||||
* `34197/udp` - Game server (required).
|
* `34197/udp` - Factorio clients (required).
|
||||||
* `27015/tcp` - RCON (optional).
|
* `27015/tcp` - RCON (optional).
|
||||||
|
|
||||||
|
|
||||||
## Environment Variables
|
|
||||||
|
|
||||||
* `PORT` (0.15+) - Start the server on an alterate port, .e.g. `docker run -e "PORT=34198"`.
|
|
||||||
|
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
**My server is listed in the server browser, but nobody can connect**
|
**Server is listed in the in-game server browser, but users can't connect**
|
||||||
|
|
||||||
Check the logs. If there is the line `Own address is RIGHT IP:WRONG PORT`, then this could be caused by the Docker proxy. If the the IP and port is correct it's probably a port forwarding or firewall issue instead.
|
Run Docker with the `--userland-proxy=false` option. The source UDP port is changed by docker-proxy when the server pings "pingpong" servers. See [Incorrect port detected for docker hosted server](https://forums.factorio.com/viewtopic.php?f=49&t=35255).
|
||||||
|
|
||||||
By default, Docker routes traffic through a proxy. The proxy changes the source UDP port, so the wrong port is detected. See the forum post *[Incorrect port detected for docker hosted server](https://forums.factorio.com/viewtopic.php?f=49&t=35255)* for details.
|
|
||||||
|
|
||||||
To fix the incorrect port, start the Docker service with the `--userland-proxy=false` switch. Docker will route traffic with iptables rules instead of a proxy. Add the switch to the `DOCKER_OPTS` environment variable or `ExecStart` in the Docker systemd service definition. The specifics vary by operating system.
|
|
||||||
|
|
||||||
**When I run a server on a port besides 34197 nobody can connect from the server browser**
|
|
||||||
|
|
||||||
Use the `PORT` environment variable to start the server on the a different port, .e.g. `docker run -e "PORT=34198"`. This changes the source port on the packets used for port detection. `-p 34198:34197` works fine for private servers, but the server browser detects the wrong port.
|
|
||||||
|
|
||||||
|
|
||||||
# Contributors
|
# Credits
|
||||||
|
|
||||||
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
|
Ideas borrowed from:
|
||||||
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Originator
|
|
||||||
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Randomly generate RCON password
|
* [Zopanix](https://github.com/zopanix/docker_factorio_server)
|
||||||
* [gnomus](https://github.com/gnomus/docker_factorio_server) - White listing
|
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio)
|
||||||
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Version update
|
|
||||||
|
Reference in New Issue
Block a user