mirror of
https://github.com/factoriotools/factorio-docker.git
synced 2025-07-04 07:58:13 +02:00
Compare commits
30 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
@ -9,8 +9,8 @@ ARG PGID=845
|
|||||||
|
|
||||||
ENV PORT=34197 \
|
ENV PORT=34197 \
|
||||||
RCON_PORT=27015 \
|
RCON_PORT=27015 \
|
||||||
VERSION=0.16.43 \
|
VERSION=0.16.51 \
|
||||||
SHA1=27d0f81747aee61f89504f7cb49f9976efc16c10 \
|
SHA1=127e7ff484ab263b13615d6114013ce0a66ac929 \
|
||||||
SAVES=/factorio/saves \
|
SAVES=/factorio/saves \
|
||||||
CONFIG=/factorio/config \
|
CONFIG=/factorio/config \
|
||||||
MODS=/factorio/mods \
|
MODS=/factorio/mods \
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#!/bin/sh -x
|
#!/bin/sh -x
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
id
|
id
|
||||||
@ -45,4 +44,5 @@ exec /opt/factorio/bin/x64/factorio \
|
|||||||
--server-banlist $CONFIG/server-banlist.json \
|
--server-banlist $CONFIG/server-banlist.json \
|
||||||
--rcon-port $RCON_PORT \
|
--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 \
|
||||||
|
$@
|
||||||
|
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.1 \
|
||||||
|
SHA1=cab0b48a5ddb1870bab2c07cc6ad5726097c1fc5 \
|
||||||
|
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 && \
|
||||||
|
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"]
|
9
0.17/docker-compose.yml
Normal file
9
0.17/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
|
58
0.17/files/docker-entrypoint.sh
Executable file
58
0.17/files/docker-entrypoint.sh
Executable file
@ -0,0 +1,58 @@
|
|||||||
|
#!/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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
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
|
||||||
|
|
||||||
|
if [ "$(id -u)" = '0' ]; then
|
||||||
|
chown -R factorio:factorio $FACTORIO_VOL
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec su-exec factorio /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
|
31
README.md
31
README.md
@ -1,15 +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.16.43`, `0.16`, `stable`, `latest` [(0.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/Dockerfile)
|
* `0.17.1`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.17/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.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.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.
|
||||||
|
|
||||||
@ -163,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).
|
||||||
@ -181,7 +200,9 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
|
|||||||
| |-- map-gen-settings.json
|
| |-- map-gen-settings.json
|
||||||
| |-- rconpw
|
| |-- rconpw
|
||||||
| |-- server-settings.json
|
| |-- server-settings.json
|
||||||
| `-- server-whitelist.json
|
| |-- server-whitelist.json
|
||||||
|
| |-- server-banlist.json
|
||||||
|
| `-- server-adminlist.json
|
||||||
|-- mods
|
|-- mods
|
||||||
| `-- fancymod.zip
|
| `-- fancymod.zip
|
||||||
`-- saves
|
`-- saves
|
||||||
|
Reference in New Issue
Block a user