mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-01 22:48:26 +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
|
||||
|
||||
ENV VERSION=0.14.23 \
|
||||
SHA1=6ef84341c6fc1cf45cfdd6acc8468aaa117b9e8a
|
||||
COPY ./factorio.crt /opt/factorio.crt
|
||||
|
||||
RUN mkdir /opt && \
|
||||
apk --no-cache add curl tini pwgen && \
|
||||
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
||||
ENV VERSION=0.14.16 \
|
||||
SHA1=e27c658bf8a7579b662a1c34815daa223e57bc90
|
||||
|
||||
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 && \
|
||||
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 && \
|
||||
apk --no-cache del curl && \
|
||||
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
|
||||
|
||||
@ -22,5 +26,4 @@ EXPOSE 34197/udp 27015/tcp
|
||||
|
||||
COPY ./docker-entrypoint.sh /
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
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
|
||||
|
||||
SAVES=/factorio/saves
|
||||
CONFIG=/factorio/config
|
||||
SAVES=/opt/factorio/saves
|
||||
|
||||
mkdir -p $SAVES
|
||||
mkdir -p /factorio/saves
|
||||
mkdir -p /factorio/mods
|
||||
mkdir -p $CONFIG
|
||||
mkdir -p /factorio/config
|
||||
|
||||
if [ ! -f $CONFIG/rconpw ]; then
|
||||
echo $(pwgen 15 1) > $CONFIG/rconpw
|
||||
if [ ! -f /factorio/config/server-settings.json ]; then
|
||||
cp /opt/factorio/data/server-settings.example.json /factorio/config/server-settings.json
|
||||
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
|
||||
if [ ! -f /factorio/config/map-gen-settings.json ]; then
|
||||
cp /opt/factorio/data/map-gen-settings.example.json /factorio/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
|
||||
--create $SAVES/save.zip \
|
||||
--map-gen-settings /opt/factorio/data/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)"
|
||||
--server-settings /opt/factorio/data/server-settings.json
|
||||
|
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 \
|
||||
-v /tmp/factorio:/factorio \
|
||||
--name factorio \
|
||||
factorio "$@"
|
||||
find /tmp/factorio -type f
|
||||
|
@ -1,28 +0,0 @@
|
||||
FROM frolvlad/alpine-glibc:alpine-3.5
|
||||
|
||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||
|
||||
ENV PORT=34197 \
|
||||
VERSION=0.15.2 \
|
||||
SHA1=b1fd6f104d746784d86730595e2411a285dfff38
|
||||
|
||||
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 && \
|
||||
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 27015/tcp
|
||||
|
||||
COPY ./docker-entrypoint.sh /
|
||||
|
||||
ENTRYPOINT ["/sbin/tini", "--"]
|
||||
CMD ["/docker-entrypoint.sh"]
|
@ -1 +0,0 @@
|
||||
sudo docker build --no-cache -t factorio .
|
@ -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 $PORT \
|
||||
--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 \
|
||||
factorio "$@"
|
||||
find /tmp/factorio -type f
|
66
README.md
66
README.md
@ -1,16 +1,6 @@
|
||||
# Factorio [](https://hub.docker.com/r/dtandersen/factorio/) [](https://hub.docker.com/r/dtandersen/factorio/)
|
||||
|
||||
* `0.15.2`, `0.15`, `latest` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
||||
* `0.14.23`, `0.14`, `stable` [(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)
|
||||
|
||||
*Tags*
|
||||
|
||||
* `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.
|
||||
* `0.14.16`, `0.14`, `latest` [(0.14.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.16/Dockerfile)
|
||||
|
||||
|
||||
# What is Factorio?
|
||||
@ -31,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`.
|
||||
|
||||
```
|
||||
docker run -d -p 34197:34197/udp -p 27015:27015/tcp \
|
||||
-v /tmp/factorio:/factorio \
|
||||
--name factorio \
|
||||
--restart=always \
|
||||
dtandersen/factorio
|
||||
docker run -d -P -v /tmp/factorio:/factorio --name factorio dtandersen/factorio
|
||||
```
|
||||
|
||||
For those new to Docker, here is an explanation of the options:
|
||||
|
||||
* `-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.
|
||||
* `--restart` - Restart the server if it crashes and at system start
|
||||
* `--name` - Name the container "factorio" (otherwise it has a funny random name).
|
||||
|
||||
Check the logs to see what happened:
|
||||
@ -69,9 +54,9 @@ Try to connect to the server. Check the logs if it isn't working.
|
||||
|
||||
## 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 `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.
|
||||
|
||||
@ -81,20 +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.
|
||||
|
||||
|
||||
## RCON
|
||||
## Remote Console
|
||||
|
||||
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
|
||||
|
||||
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 with `-p 34197:34197/udp` instead of `-P`. RCON still runs, but nobody is able to connect to it.
|
||||
RCON is currently disabled.
|
||||
|
||||
|
||||
# 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.
|
||||
* Use one volume for data.
|
||||
|
||||
@ -105,13 +86,13 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
||||
|
||||
factorio
|
||||
|-- config
|
||||
| |-- map-gen-settings.json
|
||||
| |-- rconpw
|
||||
| `-- server-settings.json
|
||||
| |-- server-settings.json
|
||||
| +-- map-gen-settings.json
|
||||
|-- mods
|
||||
| `-- fancymod.zip
|
||||
`-- saves
|
||||
`-- _autosave1.zip
|
||||
| |-- fancymod.zip
|
||||
+-- saves
|
||||
|-- _autosave1.zip
|
||||
+-- save.zip
|
||||
|
||||
|
||||
## Ports
|
||||
@ -120,24 +101,11 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
||||
* `27015/tcp` - RCON (optional).
|
||||
|
||||
|
||||
## Environment Variables
|
||||
|
||||
* `PORT` - Start the server on an alterate port, .e.g. `docker run -e "PORT=34198"`.
|
||||
|
||||
|
||||
## 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.
|
||||
|
||||
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.
|
||||
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).
|
||||
|
||||
|
||||
# Credits
|
||||
|
Reference in New Issue
Block a user