Compare commits

...

61 Commits

Author SHA1 Message Date
b41aad4dc6 update to 0.16.42 (#161) 2018-05-11 18:48:47 +02:00
24ac45dbce Merge pull request #157 from afex/master
Expose script-output to mounted volume
2018-05-04 12:19:56 -07:00
8286ab58ac update to 0.16.41 (#159) 2018-05-03 21:22:40 +02:00
c2d8509aa8 update to 0.16.40 (#158) 2018-05-03 00:53:14 +02:00
b94db83033 setup script-output directory 2018-05-02 12:45:11 -07:00
cc23bb396e expose script-output to volume 2018-05-02 12:44:34 -07:00
1b2fdb298f update to 0.16.39 (#156) 2018-04-30 20:00:30 +02:00
ab277975ae Merge pull request #153 from dtandersen/update-0.16.38
Updated to version 0.16.38
2018-04-26 11:45:23 -07:00
80d8866242 update to 0.16.38 2018-04-26 15:24:39 +00:00
4ec18b2d15 Merge pull request #152 from dtandersen/update-0.16.37
Updated to version 0.16.37
2018-04-23 10:57:13 -07:00
93a3011cd3 update to 0.16.37 2018-04-23 17:44:49 +00:00
15cacdc3da 0.16 is stable 2018-03-29 09:44:34 -07:00
927bcb89a0 Merge pull request #150 from dtandersen/update-0.16.36
Updated to version 0.16.36
2018-03-28 09:40:26 -07:00
4ceff25fc2 update to 0.16.36 2018-03-28 12:54:40 +00:00
5d072db9cc update to 0.16.35 (#149) 2018-03-24 14:37:57 +01:00
216b225681 update to 0.16.34 (#148) 2018-03-23 13:42:54 +01:00
18f3943eaf Merge pull request #146 from dtandersen/update-0.16.33
Updated to version 0.16.33
2018-03-22 10:24:01 -07:00
2725534b2b update to 0.16.33 2018-03-22 17:04:41 +00:00
df35d57455 Merge pull request #145 from dtandersen/update-0.16.32
Updated to version 0.16.32
2018-03-20 08:20:37 -07:00
9adc8ce4bc update to 0.16.32 2018-03-20 12:54:39 +00:00
6272bb0018 update to 0.16.31 (#144) 2018-03-19 20:37:39 +01:00
a989b500b0 moved entrypoints to files directory 2018-03-19 17:28:40 +00:00
66bef56cd2 moved entry points to /; dont put hard link in place of entrypoint folder 2018-03-19 16:58:53 +00:00
10f891cabf don't need to create these 2018-03-14 13:16:23 -07:00
9a7f01f8bf Merge pull request #142 from yukienterprises/temp-save-removal
Remove temp (invalid) saves on container start
2018-03-14 07:56:50 -07:00
877219f9c9 Remove temp (invalid) saves on container start 2018-03-14 23:13:43 +11:00
843bcbff21 update to 0.16.30 (#140) 2018-03-12 23:35:36 +01:00
a7786f03ed updated maintainers 2018-03-12 10:33:05 -07:00
754663df49 Merge pull request #139 from dtandersen/scenario2
Scenario tweaks
2018-03-12 10:00:12 -07:00
9ac04bcff8 moved env to Dockerfile so they can be shared 2018-03-12 16:54:17 +00:00
66d4652302 moved volume creation back as per PR#101; create symlink once 2018-03-12 09:38:40 -07:00
5ddb9ab472 Merge pull request #115 from bplein/master
Add Scenarios Folder, Alternate Entrypoints Folder
2018-03-12 09:29:15 -07:00
9e72f0509a Merge pull request #138 from dtandersen/update-0.16.29
Updated to version 0.16.29
2018-03-12 09:22:49 -07:00
914b12adf4 update to 0.16.29 2018-03-12 16:15:23 +00:00
dc3c040d7c another symlink bug 2018-03-10 17:17:16 -06:00
6a9a596cd8 fix syntax on symlink 2018-03-10 17:11:47 -06:00
eb22dac840 force symlinks 2018-03-10 17:08:09 -06:00
b48bb4c134 Merge branch 'master' of https://github.com/dtandersen/docker_factorio_server 2018-03-09 14:45:36 -06:00
cf5af1aae1 Merge pull request #137 from dtandersen/update-0.16.28
Updated to version 0.16.28
2018-03-05 12:25:24 -08:00
d7f0fe16d7 update to 0.16.28 2018-03-05 18:09:43 +00:00
27c1426109 Merged in dtandersen/factorio changes 2018-03-02 15:40:08 -06:00
a86ac6cafe Merge remote-tracking branch 'upstream/master'
Updating to catch up with upstream
2018-03-02 15:36:31 -06:00
70e08f10f3 update to 0.16.27 (#136) 2018-02-28 19:40:35 +01:00
c28cea29a4 update to 0.16.26 (#135) 2018-02-26 17:30:23 +01:00
e21fc20eb2 Merge pull request #134 from dtandersen/update-0.16.25
Updated to version 0.16.25
2018-02-20 08:14:38 -08:00
c75b7fa830 update to 0.16.25 2018-02-19 20:59:40 +00:00
387383d3e8 Merge pull request #129 from psykzz/patch-3
Fix adduser
2018-02-15 11:45:02 -08:00
c6c94ee180 update to 0.16.24 (#131) 2018-02-15 18:19:26 +01:00
b2908081b4 update to 0.16.23 (#130) 2018-02-12 12:41:55 +01:00
e53c2adc54 Fix adduser 2018-02-03 21:15:07 +00:00
d6da776148 Merge pull request #128 from dtandersen/update-0.16.22
Updated to version 0.16.22
2018-02-02 06:57:23 -08:00
30e5f6dd2d update to 0.16.22 2018-02-02 09:08:50 +00:00
b69fe57291 update to 0.16.21 (#126) 2018-02-01 16:50:20 +01:00
b99c1044ca Merge pull request #123 from dtandersen/update-0.16.20
Updated to version 0.16.20
2018-01-26 14:47:14 -08:00
b37af9bf93 update to 0.16.20 2018-01-26 21:43:48 +00:00
185ee256ff Merge pull request #122 from dtandersen/update-0.16.19
Updated to version 0.16.19
2018-01-25 14:29:24 -08:00
6020015574 update to 0.16.19 2018-01-25 19:53:49 +00:00
a520b87fc8 update to 0.16.18 (#121) 2018-01-23 13:05:56 +01:00
14fb9ecf35 Typo in Dockerfile 2018-01-16 18:24:35 -06:00
ffef5899e9 Updated Dockerfile to copy in example entrypoints 2018-01-16 18:03:13 -06:00
4449e13675 Added creation and symlinking of scenarios directory, creation and symlinking of an entrypoints directory for custom entrypoints, and two examples of using entrypoints with scenarios 2018-01-16 17:59:28 -06:00
5 changed files with 130 additions and 14 deletions

View File

@ -9,8 +9,13 @@ ARG PGID=845
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=0.16.17 \
SHA1=d1bc9d0ae4395cec66cbfa9d1845a9db4ee5741d
VERSION=0.16.42 \
SHA1=470ab5cbe036b5aedc51d577401ef37fbbdfeece \
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 && \
@ -21,18 +26,20 @@ RUN mkdir -p /opt /factorio && \
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 /factorio/saves /opt/factorio/saves && \
ln -s /factorio/mods /opt/factorio/mods && \
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 $USER -s /bin/sh -SDH $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 ./docker-entrypoint.sh /
COPY files/ /
USER $USER

View File

@ -4,14 +4,11 @@ set -e
id
SAVES=/factorio/saves
CONFIG=/factorio/config
mkdir -p $SAVES
mkdir -p /factorio/mods
mkdir -p $CONFIG
#chown -R factorio /factorio
mkdir -p $MODS
mkdir -p $SCENARIOS
mkdir -p $SCRIPTOUTPUT
if [ ! -f $CONFIG/rconpw ]; then
echo $(pwgen 15 1) > $CONFIG/rconpw
@ -29,6 +26,10 @@ 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 \

44
0.16/files/scenario.sh Executable file
View 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.16/files/scenario2map.sh Executable file
View 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

View File

@ -1,7 +1,7 @@
# Factorio [![](https://images.microbadger.com/badges/image/dtandersen/factorio.svg)](https://microbadger.com/images/dtandersen/factorio "Get your own image badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/dtandersen/factorio.svg)](https://hub.docker.com/r/dtandersen/factorio/) [![Docker Stars](https://img.shields.io/docker/stars/dtandersen/factorio.svg)](https://hub.docker.com/r/dtandersen/factorio/)
* `0.16.17`, `0.16`, `latest` [(0.16/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/Dockerfile)
* `0.15.40`, `0.15`, `stable` [(0.15/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/0.15/Dockerfile)
* `0.16.42`, `0.16`, `stable`, `latest` [(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.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)
@ -113,6 +113,38 @@ 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.
## Scenarios
If you want to launch a scenario from a clean start (not from a saved map) you'll need to start the docker image from an alternate entrypoint. To do this, use the example entrypoint file stored in the /factorio/entrypoints directory in the volume, and launch the image with the following syntax. Note that this is the normal syntax with the addition of the --entrypoint setting AND the additional argument at the end, which is the name of the Scenario in the Scenarios folder.
```
docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
--entrypoint "/scenario.sh" \
dtandersen/factorio \
MyScenarioName
```
## Converting Scenarios to Regular Maps
If you would like to export your scenario to a saved map, you can use the example entrypoint similar to the Scenario usag above. Factorio will run once, converting the Scenario to a saved Map in your saves directory. A restart of the docker image using the standard options will then load that map, just as if the scenario were just started by the Scenarios example noted above.
```
docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
--entrypoint "/scenario2map.sh" \
dtandersen/factorio
MyScenarioName
```
## RCON
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
@ -256,7 +288,9 @@ Use the `PORT` environment variable to start the server on the a different port,
# Contributors
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
* [Fank](https://github.com/Fankserver/docker-factorio-watchdog) - Keeper of the Factorio watchdog that keeps the version up-to-date.
* [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
* [bplein](https://github.com/bplein/docker_factorio_server) - Scenario support
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Version update