mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-01 14:38:05 +02:00
Compare commits
111 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 | |||
52dd896f3c | |||
3a5ce81d2e | |||
ad707ee2ad | |||
61fd28bb36 | |||
892a684f98 | |||
a0cedba383 | |||
893c1b6214 | |||
0d79b49393 | |||
9d3f88ed6b | |||
a0338cc7b3 | |||
ed1fe2ba82 | |||
46769a042d | |||
0a5893578f | |||
59b35f3ac0 | |||
8138589baf | |||
2b1115c19a | |||
b6276d7b51 | |||
82a15c8f34 | |||
0fbcfbf857 | |||
dc89065e68 | |||
bd5a44dce5 | |||
26584556a3 | |||
3a70062289 | |||
c3fe70f783 | |||
7a5732bbcd | |||
a496ba060b | |||
7e78a4236f | |||
0c5ff73adb | |||
9ad1889aeb | |||
2a23a3fe91 | |||
cfcbb035a7 | |||
10f8b0acb6 | |||
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 |
@ -1,21 +1,22 @@
|
|||||||
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.0 \
|
VERSION=0.15.36 \
|
||||||
SHA1=e7681725203afeb0645371c695989129076e51bc
|
SHA1=95bc578f48768f44c3a6c38005a038740de4951a
|
||||||
|
|
||||||
RUN mkdir /opt && \
|
RUN mkdir /opt && \
|
||||||
apk --no-cache add curl tini pwgen && \
|
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 \
|
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
|
||||||
-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 && \
|
||||||
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
rm /tmp/factorio_headless_x64_$VERSION.tar.xz && \
|
||||||
apk 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 && \
|
||||||
|
apk del .build-deps
|
||||||
|
|
||||||
VOLUME /factorio
|
VOLUME /factorio
|
||||||
|
|
||||||
|
@ -1 +0,0 @@
|
|||||||
sudo docker build --no-cache -t factorio .
|
|
@ -1 +0,0 @@
|
|||||||
sudo rm -rf /tmp/factorio
|
|
8
0.15/docker-compose.yml
Normal file
8
0.15/docker-compose.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: '2'
|
||||||
|
services:
|
||||||
|
factorio:
|
||||||
|
build: .
|
||||||
|
ports:
|
||||||
|
- "34197:34197"
|
||||||
|
volumes:
|
||||||
|
- /tmp/factorio:/factorio
|
@ -21,15 +21,23 @@ 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 \
|
||||||
--port $PORT \
|
--port $PORT \
|
||||||
--start-server-load-latest \
|
--start-server-load-latest \
|
||||||
--server-settings $CONFIG/server-settings.json \
|
--server-settings $CONFIG/server-settings.json \
|
||||||
|
--server-whitelist $CONFIG/server-whitelist.json \
|
||||||
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
--rcon-port 27015 \
|
--rcon-port 27015 \
|
||||||
--rcon-password "$(cat $CONFIG/rconpw)"
|
--rcon-password "$(cat $CONFIG/rconpw)" \
|
||||||
|
--server-id /factorio/config/server-id.json
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
sudo docker run --rm -it \
|
|
||||||
-v /tmp/factorio:/factorio \
|
|
||||||
--name factorio \
|
|
||||||
factorio "$@"
|
|
||||||
find /tmp/factorio -type f
|
|
74
README.md
74
README.md
@ -1,15 +1,18 @@
|
|||||||
# 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.15.0`, `0.15`, `latest` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
|
* `0.15.36`, `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.15.36`, `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)
|
* `0.13.20`, `0.13` [(0.13/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.13/Dockerfile)
|
||||||
|
|
||||||
*Tag philosophy*
|
*Tag descriptions*
|
||||||
|
|
||||||
* `latest` - highest version: may be experimental.
|
* `latest` - highest version: may be experimental.
|
||||||
* `stable` - highest version declared stable.
|
* `stable` - highest version declared stable.
|
||||||
* `0.x` - highest version in a branch: may be experimental.
|
* `0.x` - highest version in a branch: may be experimental.
|
||||||
* `0.x.y` - a specific version.
|
* `0.x.y` - a specific version.
|
||||||
|
* `0.x-dev` - whatever is in master for that version.
|
||||||
|
|
||||||
|
|
||||||
# What is Factorio?
|
# What is Factorio?
|
||||||
|
|
||||||
@ -65,9 +68,34 @@ 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` 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 `/tmp/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.
|
||||||
|
|
||||||
@ -83,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.
|
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
|
# 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).
|
||||||
@ -105,7 +142,8 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|||||||
|-- config
|
|-- config
|
||||||
| |-- map-gen-settings.json
|
| |-- map-gen-settings.json
|
||||||
| |-- rconpw
|
| |-- rconpw
|
||||||
| `-- server-settings.json
|
| |-- server-settings.json
|
||||||
|
| `-- server-whitelist.json
|
||||||
|-- mods
|
|-- mods
|
||||||
| `-- fancymod.zip
|
| `-- fancymod.zip
|
||||||
`-- saves
|
`-- saves
|
||||||
@ -114,10 +152,15 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|||||||
|
|
||||||
## Ports
|
## Ports
|
||||||
|
|
||||||
* `34197/udp` - Factorio clients (required).
|
* `34197/udp` - Game server (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**
|
**My server is listed in the server browser, but nobody can connect**
|
||||||
@ -128,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.
|
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)
|
# Contributors
|
||||||
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio)
|
|
||||||
|
* [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