mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-02 23:18:06 +02:00
Compare commits
240 Commits
Author | SHA1 | Date | |
---|---|---|---|
c7309c1e5c | |||
c845acc09f | |||
8bfe8b0261 | |||
2c7cfc6c65 | |||
1250578039 | |||
97165cfdde | |||
c6f144aff4 | |||
481246c449 | |||
97cdaa825a | |||
b36c299358 | |||
4e09965476 | |||
5340267672 | |||
061d0c6c37 | |||
84af48c346 | |||
2ca5f1368c | |||
bc0ef1b51e | |||
b2fbd707f8 | |||
a88071d1aa | |||
a1f590270b | |||
b0b5775365 | |||
c988684348 | |||
75e98e0543 | |||
0bc55d51a8 | |||
c50665c37f | |||
81c9d50e7a | |||
c3631942e8 | |||
8e072e8c24 | |||
c260815680 | |||
fd4680704f | |||
b46eefee58 | |||
76a76765bb | |||
d6331587b4 | |||
dfbd6baff6 | |||
4872cf89f6 | |||
99c0355d12 | |||
7b351c473a | |||
b839d7d339 | |||
40974755b6 | |||
548f9b27d0 | |||
be99942271 | |||
f19f731662 | |||
eea4c90fa5 | |||
ce161daf33 | |||
a3d7c55f68 | |||
736dbea3b3 | |||
aeb549b3b5 | |||
2906b59721 | |||
abdce572de | |||
ca7fc9ff13 | |||
ebcca5251c | |||
b72b906fdb | |||
b643a13e88 | |||
6499b0974e | |||
c9052c3296 | |||
832e64511d | |||
a3890f37fa | |||
4089f8d59a | |||
4026ec5359 | |||
9e93a34d6e | |||
05d697afac | |||
d9a5604448 | |||
128e15db7c | |||
71e9179722 | |||
e3a97f3448 | |||
5506d33475 | |||
0314266309 | |||
16a85d32e9 | |||
d36578a471 | |||
9f8453645a | |||
eb4814f16c | |||
c85ce5e75a | |||
d4a5f0f019 | |||
8222bd1b45 | |||
de26a241af | |||
ea4843498b | |||
009548446f | |||
a48b23201b | |||
e9962a431b | |||
2f41a0d660 | |||
53c953707b | |||
b53d98cb2a | |||
833de3cc46 | |||
d94543bbcd | |||
7074d5284b | |||
c119b077c8 | |||
479d7e2fe1 | |||
1247c62b13 | |||
a7f765a070 | |||
1c8b9fd5b9 | |||
1ddcbec2c5 | |||
2d82e0a19c | |||
6320dd04df | |||
1ea5ddfbee | |||
067ac0ac14 | |||
036a15ce1e | |||
003f0cdbe6 | |||
43fafdcfe5 | |||
667bd97388 | |||
62da6f5f56 | |||
47ca759742 | |||
e12e303d2d | |||
ebf0afa524 | |||
1b5a9d5b9e | |||
3404976818 | |||
ba68274a7b | |||
ee509835db | |||
ee3385959d | |||
0ac68ac31a | |||
552520136d | |||
2b63d0ef0e | |||
390c76906b | |||
5bc0e128f1 | |||
0fdac9cebb | |||
86ec899b06 | |||
81edeb0183 | |||
08090e70a0 | |||
16602ba40b | |||
16b6a5b253 | |||
44f5ffd6b4 | |||
8fd01ef07f | |||
6b8c0f01ab | |||
284e7f00b0 | |||
abe0c82a8e | |||
f90f3c7569 | |||
9dca3590ae | |||
1e7c8bc8b7 | |||
4ed57b0c20 | |||
88258a263e | |||
f3df464856 | |||
3a007b377f | |||
ddf7f99a2b | |||
8a3df67b52 | |||
14b11329d7 | |||
2d79854697 | |||
65658b10d6 | |||
be4c89d937 | |||
cb52eb3dff | |||
322fe61b13 | |||
3e42118a04 | |||
ee861acee5 | |||
f69732d4f8 | |||
86914046e0 | |||
f7c2b144ce | |||
a2179f3f61 | |||
3cc553c786 | |||
0b3a7bd84c | |||
a28d8315aa | |||
14d1af4d9e | |||
b8c0e42baa | |||
148c01eab0 | |||
99c79f7e64 | |||
11f92f34d8 | |||
186af111d9 | |||
b6f14800ab | |||
4a5504cdb6 | |||
0e8cb6c26c | |||
b950fe99c6 | |||
6ed85052ff | |||
30425c8d66 | |||
522a3a2e93 | |||
e37cdcc508 | |||
7babfe47ff | |||
bfd2c5f600 | |||
3fc2e97f7e | |||
d141764f44 | |||
4a816ad5f9 | |||
d1aa470d25 | |||
70e936c7e3 | |||
f17e773885 | |||
c8af86eaef | |||
dcac7d0c46 | |||
b6d1748deb | |||
e1e8ff07e6 | |||
601ee80a47 | |||
fd4ed925b2 | |||
2d1f625219 | |||
7d5e58d4a0 | |||
c535246dac | |||
16959ea374 | |||
8f6446f088 | |||
65a32b3cbf | |||
7ca5892e5e | |||
327fd1c925 | |||
323718b631 | |||
8049134ed5 | |||
0a35d754ec | |||
cf60f77d53 | |||
65315ccfa8 | |||
e7ac99c855 | |||
7798e07daf | |||
993ca2631c | |||
a0551876fa | |||
74a32021de | |||
545297c443 | |||
a9fc7f32d9 | |||
fd2f656e57 | |||
d99ff47bbc | |||
b056148d75 | |||
dfb8b32a10 | |||
78c79d8fe9 | |||
aa587d172c | |||
a4f5d9a10a | |||
09be8bf68a | |||
f589953648 | |||
46d525bcf7 | |||
115dc3b1a9 | |||
310cb82749 | |||
308f7cad10 | |||
9044045dac | |||
a1e701df66 | |||
87141b2835 | |||
a6476af82f | |||
12ec73be53 | |||
ef4c0132d4 | |||
764b214723 | |||
dcd07982a8 | |||
7880bd9f65 | |||
27fc3b97bc | |||
ce1320100b | |||
3ea1619384 | |||
52bd19356f | |||
bc55163f5c | |||
5a4e0d8ebf | |||
361bb94857 | |||
048d12ef75 | |||
4d8c94a6c8 | |||
fa1af6c03d | |||
d8b20e5531 | |||
bdb51f5020 | |||
87d1c4b0a3 | |||
89ef301d3d | |||
0960c7c371 | |||
cc496ccaa0 | |||
f9e62fe90d | |||
94494299ee | |||
677dc983e8 | |||
8588fdd6fd | |||
eb22619e44 | |||
6f33dd8444 | |||
43af3aaf33 |
@ -2,8 +2,8 @@ FROM frolvlad/alpine-glibc:alpine-3.4
|
||||
|
||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||
|
||||
ENV VERSION=0.14.20 \
|
||||
SHA1=d7c93754b543270aaa170aee01d8fd75fcc32c58
|
||||
ENV VERSION=0.14.23 \
|
||||
SHA1=6ef84341c6fc1cf45cfdd6acc8468aaa117b9e8a
|
||||
|
||||
RUN mkdir /opt && \
|
||||
apk --no-cache add curl tini pwgen && \
|
||||
|
28
0.15/Dockerfile
Normal file
28
0.15/Dockerfile
Normal file
@ -0,0 +1,28 @@
|
||||
FROM frolvlad/alpine-glibc:alpine-3.5
|
||||
|
||||
MAINTAINER https://github.com/dtandersen/docker_factorio_server
|
||||
|
||||
ENV PORT=34197 \
|
||||
VERSION=0.15.8 \
|
||||
SHA1=365efc98527787d557bcea342a1b9a544d18a93c
|
||||
|
||||
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.15/build.sh
Executable file
1
0.15/build.sh
Executable file
@ -0,0 +1 @@
|
||||
sudo docker build --no-cache -t factorio .
|
1
0.15/clean.sh
Executable file
1
0.15/clean.sh
Executable file
@ -0,0 +1 @@
|
||||
sudo rm -rf /tmp/factorio
|
36
0.15/docker-entrypoint.sh
Executable file
36
0.15/docker-entrypoint.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/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 \
|
||||
--server-whitelist $CONFIG/server-whitelist.json \
|
||||
--rcon-port 27015 \
|
||||
--rcon-password "$(cat $CONFIG/rconpw)"
|
5
0.15/run.sh
Executable file
5
0.15/run.sh
Executable file
@ -0,0 +1,5 @@
|
||||
sudo docker run --rm -it \
|
||||
-v /tmp/factorio:/factorio \
|
||||
--name factorio \
|
||||
factorio "$@"
|
||||
find /tmp/factorio -type f
|
5
0.15/start.sh
Executable file
5
0.15/start.sh
Executable file
@ -0,0 +1,5 @@
|
||||
sudo docker run -d -p 34197:34197/udp -p 27015:27015/tcp \
|
||||
-v factorio:/factorio \
|
||||
--name factorio \
|
||||
--restart=always \
|
||||
factorio
|
77
README.md
77
README.md
@ -1,9 +1,19 @@
|
||||
# Factorio [](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.14.20`, `0.14`, `latest` [(0.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.14/Dockerfile)
|
||||
* `0.14.19`, `stable` [(0.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.19/0.14/Dockerfile)
|
||||
* `0.15.8`, `latest` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
||||
* `0.15.6`, `0.15` [(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)
|
||||
|
||||
*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?
|
||||
|
||||
[Factorio](https://www.factorio.com) is a game in which you build and maintain factories.
|
||||
@ -58,6 +68,31 @@ docker start factorio
|
||||
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
|
||||
|
||||
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.
|
||||
@ -76,11 +111,20 @@ Copy mods into the mods folder and restart the server.
|
||||
|
||||
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 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.
|
||||
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
|
||||
|
||||
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
|
||||
@ -98,7 +142,8 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
||||
|-- config
|
||||
| |-- map-gen-settings.json
|
||||
| |-- rconpw
|
||||
| `-- server-settings.json
|
||||
| |-- server-settings.json
|
||||
| `-- server-whitelist.json
|
||||
|-- mods
|
||||
| `-- fancymod.zip
|
||||
`-- saves
|
||||
@ -107,10 +152,15 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
||||
|
||||
## Ports
|
||||
|
||||
* `34197/udp` - Factorio clients (required).
|
||||
* `34197/udp` - Game server (required).
|
||||
* `27015/tcp` - RCON (optional).
|
||||
|
||||
|
||||
## Environment Variables
|
||||
|
||||
* `PORT` (0.15+) - 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**
|
||||
@ -121,10 +171,15 @@ By default, Docker routes traffic through a proxy. The proxy changes the source
|
||||
|
||||
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**
|
||||
|
||||
# Credits
|
||||
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.
|
||||
|
||||
Ideas borrowed from:
|
||||
|
||||
* [Zopanix](https://github.com/zopanix/docker_factorio_server)
|
||||
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio)
|
||||
# Contributors
|
||||
|
||||
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
|
||||
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Originator
|
||||
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Randomly generate RCON password
|
||||
* [gnomus](https://github.com/gnomus/docker_factorio_server) - White listing
|
||||
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Version update
|
||||
|
Reference in New Issue
Block a user