From 5d5cb71a908374efc27133e4d71f1eede9abb100 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 14:11:05 -0700 Subject: [PATCH 01/34] verify SHA1 checksum --- Dockerfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 485b830..072736a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,11 +22,16 @@ ENV FACTORIO_DISSALOW_COMMANDS true ENV FACOTIO_NO_AUTO_PAUSE false +ENV VERSION=0.12.30 +ENV FACTORIO_SHA1="77d92ecc52989f3283462fd5c9b5ba07eb6081cc" + RUN echo "# Installing curl" && \ apt-get update && \ apt-get install -y curl && \ echo "# Downloading and unzipping factorio" && \ - curl -L -k https://www.factorio.com/get-download/0.12.30/headless/linux64 | tar -xzf - && \ + curl -L -k https://www.factorio.com/get-download/$VERSION/headless/linux64 -o /tmp/factorio_headless_x64_$VERSION.tar.gz && \ + echo "$FACTORIO_SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c - && \ + tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz && \ echo "# Cleaning" && \ apt-get remove -y --purge curl && \ apt-get autoremove -y --purge && \ From a34b260d1507820fa0eb3020d6e544cf7b749a7c Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 15:20:14 -0700 Subject: [PATCH 02/34] combined ENVs to reduce layer count --- Dockerfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 072736a..0272071 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,16 +14,12 @@ VOLUME "/opt/factorio/saves" VOLUME "/opt/factorio/mods" -ENV FACTORIO_AUTOSAVE_INTERVAL 2 - -ENV FACTORIO_AUTOSAVE_SLOTS 3 - -ENV FACTORIO_DISSALOW_COMMANDS true - -ENV FACOTIO_NO_AUTO_PAUSE false - -ENV VERSION=0.12.30 -ENV FACTORIO_SHA1="77d92ecc52989f3283462fd5c9b5ba07eb6081cc" +ENV FACTORIO_AUTOSAVE_INTERVAL=2 \ + FACTORIO_AUTOSAVE_SLOTS=3 \ + FACTORIO_DISSALOW_COMMANDS=true \ + FACTORIO_NO_AUTO_PAUSE=false \ + VERSION=0.12.30 \ + FACTORIO_SHA1="77d92ecc52989f3283462fd5c9b5ba07eb6081cc" RUN echo "# Installing curl" && \ apt-get update && \ From fb0d7d955bd4ff65efd6bfdb2ceb2df758a95872 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 16:02:34 -0700 Subject: [PATCH 03/34] Moved factorio link to the top --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 01bd04a..f901e4b 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,12 @@ Factorio ===== -Factorio Server in docker +A Docker image for the headless [Factorio](http://www.factorio.com) server. Current Version ----- 0.12.30 + ### What's new ? -#### Factorio -See [factorio's site](http://www.factorio.com) -#### Docker image * Added possibility to add the no-auto-pause option * Added possibility to allow commands in game * Automatically takes latest save or autosave. when restarting the container. From 5edbcd905576ff37ce727bb0fb773a9999a86dcf Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 17:55:24 -0700 Subject: [PATCH 04/34] try using alpine images --- Dockerfile | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0272071..010de5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:latest +FROM frolvlad/alpine-glibc:alpine-3.3_glibc-2.23 MAINTAINER zopanix @@ -6,30 +6,23 @@ WORKDIR /opt COPY ./smart_launch.sh /opt -CMD ["./smart_launch.sh"] - -EXPOSE 34197/udp - -VOLUME "/opt/factorio/saves" - -VOLUME "/opt/factorio/mods" +VOLUME /opt/factorio/saves /opt/factorio/mods ENV FACTORIO_AUTOSAVE_INTERVAL=2 \ FACTORIO_AUTOSAVE_SLOTS=3 \ FACTORIO_DISSALOW_COMMANDS=true \ FACTORIO_NO_AUTO_PAUSE=false \ VERSION=0.12.30 \ - FACTORIO_SHA1="77d92ecc52989f3283462fd5c9b5ba07eb6081cc" + FACTORIO_SHA1=77d92ecc52989f3283462fd5c9b5ba07eb6081cc -RUN echo "# Installing curl" && \ - apt-get update && \ - apt-get install -y curl && \ - echo "# Downloading and unzipping factorio" && \ +RUN apk --update add bash curl && \ curl -L -k https://www.factorio.com/get-download/$VERSION/headless/linux64 -o /tmp/factorio_headless_x64_$VERSION.tar.gz && \ - echo "$FACTORIO_SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c - && \ + ls -al /tmp && \ + sha1sum -b /tmp/factorio_headless_x64_$VERSION.tar.gz && \ + echo "$FACTORIO_SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -b -c && \ tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz && \ - echo "# Cleaning" && \ - apt-get remove -y --purge curl && \ - apt-get autoremove -y --purge && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + rm /tmp/factorio_headless_x64_$VERSION.tar.gz + +EXPOSE 34197/udp + +CMD ["./smart_launch.sh"] From b56ab27e52e0b1ca9deaec0cb575ab17599b05d6 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 17:55:35 -0700 Subject: [PATCH 05/34] factorio ssl cert --- factorio.crt | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 factorio.crt diff --git a/factorio.crt b/factorio.crt new file mode 100644 index 0000000..e4525dc --- /dev/null +++ b/factorio.crt @@ -0,0 +1,98 @@ +-----BEGIN CERTIFICATE----- +MIIFUzCCBDugAwIBAgIRAM0lAXnqiIwRxaRxtw5IQLEwDQYJKoZIhvcNAQELBQAw +gZAxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE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bS9BZGRUcnVzdEV4dGVy +bmFsQ0FSb290LmNybDA1BggrBgEFBQcBAQQpMCcwJQYIKwYBBQUHMAGGGWh0dHA6 +Ly9vY3NwLnVzZXJ0cnVzdC5jb20wDQYJKoZIhvcNAQEMBQADggEBAGS/g/FfmoXQ +zbihKVcN6Fr30ek+8nYEbvFScLsePP9NDXRqzIGCJdPDoCpdTPW6i6FtxFQJdcfj +Jw5dhHk3QBN39bSsHNA7qxcS1u80GH4r6XnTq1dFDK8o+tDb5VCViLvfhVdpfZLY +Uspzgb8c8+a4bmYRBbMelC1/kZWSWfFMzqORcUx8Rww7Cxn2obFshj5cqsQugsv5 +B5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9Hvx +PUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR +pu/xO28QOG8= +-----END CERTIFICATE----- From 602881a0d958071fd50f157eba2d9c6c16aaf4d0 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:05:59 -0700 Subject: [PATCH 06/34] added CA root; removed domain cert --- factorio.crt | 56 +++++++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/factorio.crt b/factorio.crt index e4525dc..67de129 100644 --- a/factorio.crt +++ b/factorio.crt @@ -1,35 +1,4 @@ -----BEGIN CERTIFICATE----- -MIIFUzCCBDugAwIBAgIRAM0lAXnqiIwRxaRxtw5IQLEwDQYJKoZIhvcNAQELBQAw -gZAxCzAJBgNVBAYTAkdCMRswGQYDVQQIExJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO -BgNVBAcTB1NhbGZvcmQxGjAYBgNVBAoTEUNPTU9ETyBDQSBMaW1pdGVkMTYwNAYD -VQQDEy1DT01PRE8gUlNBIERvbWFpbiBWYWxpZGF0aW9uIFNlY3VyZSBTZXJ2ZXIg -Q0EwHhcNMTYwNDExMDAwMDAwWhc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nZlckNB -LmNydDAkBggrBgEFBQcwAYYYaHR0cDovL29jc3AuY29tb2RvY2EuY29tMCcGA1Ud -EQQgMB6CDiouZmFjdG9yaW8uY29tggxmYWN0b3Jpby5jb20wDQYJKoZIhvcNAQEL -BQADggEBAE+OOhuy0VIDuqD2mnJj2hySi8I3GcCp7aZkuqx/EACop9MBKkSa5oay -XZEzmmaLhpvLFULtwmvVpAEhbVpf+B3HZZ2rrhbW3WhUVMrIHPFT+sgDLPy6fNO6 -7gep0X97tpbTpXT29V8g1WTiDNeuMWEhplfJx2q65CmeRdZOMRJrkivZrkofjmOy -GcrehfI1xXTZ/mE1DNWnYsLbM8+V9doeM+xgg48z8xJ8F6q5JTLcmv8fISqzbERV -8+tPkffn29pXLq18c/23cfEQZCWPB/SMh9BTfmDgVAprQ3iyYOsxw0Ga9LzLQydY -S4oG0jnVW1AoqAJfBluwGcCZ7iNzuC8= ------END CERTIFICATE----- ------BEGIN CERTIFICATE----- MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV @@ -96,3 +65,28 @@ B5a6SE2Q8pTIqXOi6wZ7I53eovNNVZ96YUWYGGjHXkBrI/V5eu+MtWuLt29G9Hvx PUsE2JOAWVrgQSQdso8VYFhH2+9uRv0V9dlfmrPb2LjkQLPNlzmuhbsdjrzch5vR pu/xO28QOG8= -----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGR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w5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- From a97763a0e1fdf38459aaa69959bb54c5e4d71fa9 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:06:32 -0700 Subject: [PATCH 07/34] re-enabled SSL security --- Dockerfile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 010de5b..f1da84c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ MAINTAINER zopanix WORKDIR /opt COPY ./smart_launch.sh /opt +COPY ./factorio.crt /opt VOLUME /opt/factorio/saves /opt/factorio/mods @@ -16,10 +17,8 @@ ENV FACTORIO_AUTOSAVE_INTERVAL=2 \ FACTORIO_SHA1=77d92ecc52989f3283462fd5c9b5ba07eb6081cc RUN apk --update add bash curl && \ - curl -L -k https://www.factorio.com/get-download/$VERSION/headless/linux64 -o /tmp/factorio_headless_x64_$VERSION.tar.gz && \ - ls -al /tmp && \ - sha1sum -b /tmp/factorio_headless_x64_$VERSION.tar.gz && \ - echo "$FACTORIO_SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -b -c && \ + curl -sSL --cacert /opt/factorio.crt https://www.factorio.com/get-download/$VERSION/headless/linux64 -o /tmp/factorio_headless_x64_$VERSION.tar.gz && \ + echo "$FACTORIO_SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c && \ tar xzf /tmp/factorio_headless_x64_$VERSION.tar.gz && \ rm /tmp/factorio_headless_x64_$VERSION.tar.gz From d089b029415e4a68b3fbde131ceda52c5259b37c Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:23:36 -0700 Subject: [PATCH 08/34] point to dtandersen repo --- README.md | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 9663d9e..0db4945 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,21 @@ Factorio ===== -A Docker image for the headless [Factorio](http://www.factorio.com) server. +An Alpine based Docker image for the headless [Factorio](http://www.factorio.com) server. Current Version ----- 0.12.30 -### What's new ? -* Added possibility to add the no-auto-pause option -* Added possibility to allow commands in game -* Automatically takes latest save or autosave. when restarting the container. -* Added possibility to change default autosave interval -* Added possibility to change default autosave slots -* Added possibility to mount a mod volume to have your mods in your multiplayer session +### Features +* Automatically takes latest save or autosave when restarting the container. +* Volumes for saves and mods +* Set autosave interval and number of saves. +* Enable/disable the no-auto-pause option. +* Enable/disable console commands in game. Versions ----- -I'm keeping the image up to date. If you need to use an older version, checkout out the different [tags](https://hub.docker.com/r/zopanix/factorio/tags/). +If you need to use an older version, checkout out the different [tags](https://hub.docker.com/r/dtandersen/factorio/tags/). How to use ? ----- @@ -26,7 +25,7 @@ This runs factorio with default settings, and your save will be kept : docker run -d \ -v [PATH]:/opt/factorio/saves \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` * Where [PATH] is a folder where you'll put your saves, if there already is a save in it with the string "save", that one will be taken by default, otherwize, a new one will be made. * Where [PORT] is the port number you choose, if you're going to launch it on your local machine, don't use the port 34197, take another one at random. @@ -36,7 +35,7 @@ docker run -d \ ``` docker run -d \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` This will generate a new random map with default settings. #### With map persistence @@ -44,7 +43,7 @@ This will generate a new random map with default settings. docker run -d \ -v [PATH]:/opt/factorio/saves \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` This will generate a new random map with default settings and save it onto the volume. Replace [PATH] with a path to a folder on the host where the map will be saved. @@ -53,7 +52,7 @@ Replace [PATH] with a path to a folder on the host where the map will be saved. docker run -d \ -v [PATH]:/opt/factorio/saves \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` It's the same as above, it takes the last modified file which contains the word save in the filename as current save when booting the server. This allows when upgrading the container to take the last save, you don't have to rename the last autosave as save.zip #### Autosave interval @@ -62,7 +61,7 @@ You can set the autosave interval. By default it is set at 2 minutes bud you can docker run -d \ --env FACTORIO_AUTOSAVE_INTERVAL=[NUMBER] \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` Where [NUMBER] is the number of minutes between autosaves. #### Autosave slots @@ -71,7 +70,7 @@ You can set the number of autosave slots. By default it is set at 3 slots bud yo docker run -d \ --env FACTORIO_AUTOSAVE_SLOTS=[NUMBER] \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` Where [NUMBER] is the number of autosave slots. #### Mounting mod volume @@ -80,7 +79,7 @@ As everybody knows about factorio is you can add mods to it. Now you can also do docker run -d \ -v [PATH]:/opt/factorio/mods \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` Where [PATH] is the path to the folder with your mods. #### Allowing in-game commands @@ -89,7 +88,7 @@ I've always disabled in-game commands because I think it is like cheating, howev docker run -d \ --env FACTORIO_DISSALOW_COMMANDS=false \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` #### Activating no-auto-pause in the game when no one is on the server I do not recommend this feature, bud it can make the game more difficult if you're up for a challenge :-). Just set the "FACTORIO_NO_AUTO_PAUSE" variable to "true". @@ -97,7 +96,9 @@ I do not recommend this feature, bud it can make the game more difficult if you' docker run -d \ --env FACTORIO_NO_AUTO_PAUSE=true \ -p [PORT]:34197/udp \ - zopanix/factorio + dtandersen/factorio ``` -### ToDo's -* Add cutom savename for people with a lot of saves + +### Credits + +Based on [Zopanix' Factorio Server](https://github.com/zopanix/docker_factorio_server). From 257e1751c2a24b3428e9cf412fee2446be8c3970 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:37:25 -0700 Subject: [PATCH 09/34] added description of factorio --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0db4945..cf57256 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ -Factorio +What is Factorio? ===== -An Alpine based Docker image for the headless [Factorio](http://www.factorio.com) server. +[Factorio](https://www.factorio.com) is a game in which you build and maintain factories. + +You will be mining resources, researching technologies, building infrastructure, automating production and fighting enemies. Use your imagination to design your factory, combine simple elements into ingenious structures, apply management skills to keep it working and finally protect it from the creatures who don't really like you. + +The game is very stable and optimized for building massive factories. You can create your own maps, write mods in Lua or play with friends via Multiplayer. + +NOTE: This is only the server. The game is available on [Steam](http://store.steampowered.com/app/427520/). Current Version ----- @@ -12,12 +18,13 @@ Current Version * Set autosave interval and number of saves. * Enable/disable the no-auto-pause option. * Enable/disable console commands in game. +* Based on Alpine Linux. Versions ----- If you need to use an older version, checkout out the different [tags](https://hub.docker.com/r/dtandersen/factorio/tags/). -How to use ? +How to use this image? ----- ### I just want to play ! This runs factorio with default settings, and your save will be kept : From d614babc548f5aa5af5572f53fff4f38b46d1c2a Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:41:33 -0700 Subject: [PATCH 10/34] added fancy bagde --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cf57256..beea63f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![](https://badge.imagelayers.io/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') + What is Factorio? ===== [Factorio](https://www.factorio.com) is a game in which you build and maintain factories. From 199f6c7f5951ba467c4cc8b82f2097d0f7975b72 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:45:25 -0700 Subject: [PATCH 11/34] added versions to top --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index beea63f..88e184b 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Supported tags and respective Dockerfile links + +* `0.12.30`, `latest` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/Dockerfile) + [![](https://badge.imagelayers.io/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') What is Factorio? From 2fc2b7656d5edf44d989a748c2da477a9baa982a Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:48:52 -0700 Subject: [PATCH 12/34] reformat docs --- README.md | 66 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 88e184b..33d91f5 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![](https://badge.imagelayers.io/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') -What is Factorio? -===== +# What is Factorio? + [Factorio](https://www.factorio.com) is a game in which you build and maintain factories. You will be mining resources, researching technologies, building infrastructure, automating production and fighting enemies. Use your imagination to design your factory, combine simple elements into ingenious structures, apply management skills to keep it working and finally protect it from the creatures who don't really like you. @@ -14,11 +14,7 @@ The game is very stable and optimized for building massive factories. You can cr NOTE: This is only the server. The game is available on [Steam](http://store.steampowered.com/app/427520/). -Current Version ------ -0.12.30 - -### Features +# Features * Automatically takes latest save or autosave when restarting the container. * Volumes for saves and mods * Set autosave interval and number of saves. @@ -26,14 +22,12 @@ Current Version * Enable/disable console commands in game. * Based on Alpine Linux. -Versions ------ -If you need to use an older version, checkout out the different [tags](https://hub.docker.com/r/dtandersen/factorio/tags/). +# How to use this image? + +## Quick Start + +This runs factorio with default settings, and your save will be kept: -How to use this image? ------ -### I just want to play ! -This runs factorio with default settings, and your save will be kept : ``` docker run -d \ -v [PATH]:/opt/factorio/saves \ @@ -43,15 +37,19 @@ docker run -d \ * Where [PATH] is a folder where you'll put your saves, if there already is a save in it with the string "save", that one will be taken by default, otherwize, a new one will be made. * Where [PORT] is the port number you choose, if you're going to launch it on your local machine, don't use the port 34197, take another one at random. -### Advanced usage -#### Without map persistence +## Advanced usage + +### Without map persistence + ``` docker run -d \ -p [PORT]:34197/udp \ dtandersen/factorio ``` This will generate a new random map with default settings. -#### With map persistence + +### With map persistence + ``` docker run -d \ -v [PATH]:/opt/factorio/saves \ @@ -60,7 +58,9 @@ docker run -d \ ``` This will generate a new random map with default settings and save it onto the volume. Replace [PATH] with a path to a folder on the host where the map will be saved. -#### With existing map + +### With existing map + ``` docker run -d \ -v [PATH]:/opt/factorio/saves \ @@ -68,8 +68,10 @@ docker run -d \ dtandersen/factorio ``` It's the same as above, it takes the last modified file which contains the word save in the filename as current save when booting the server. This allows when upgrading the container to take the last save, you don't have to rename the last autosave as save.zip -#### Autosave interval -You can set the autosave interval. By default it is set at 2 minutes bud you can change it by launching the container with the "FACTORIO_AUTOSAVE_INTERVAL" variable to whatever suits you best. + +### Autosave interval + +You can set the autosave interval. By default it is set at 2 minutes bud you can change it by launching the container with the `FACTORIO_AUTOSAVE_INTERVAL` variable to whatever suits you best. ``` docker run -d \ --env FACTORIO_AUTOSAVE_INTERVAL=[NUMBER] \ @@ -77,8 +79,10 @@ docker run -d \ dtandersen/factorio ``` Where [NUMBER] is the number of minutes between autosaves. -#### Autosave slots -You can set the number of autosave slots. By default it is set at 3 slots bud you can change it by launching the container with the "FACTORIO_AUTOSAVE_SLOTS" variable to whatever suits you best. + +### Autosave slots + +You can set the number of autosave slots. By default it is set at 3 slots bud you can change it by launching the container with the `FACTORIO_AUTOSAVE_SLOTS` variable to whatever suits you best. ``` docker run -d \ --env FACTORIO_AUTOSAVE_SLOTS=[NUMBER] \ @@ -86,7 +90,9 @@ docker run -d \ dtandersen/factorio ``` Where [NUMBER] is the number of autosave slots. -#### Mounting mod volume + +### Mounting mod volume + As everybody knows about factorio is you can add mods to it. Now you can also do it in this docker image by mounting a volume. ``` docker run -d \ @@ -95,16 +101,20 @@ docker run -d \ dtandersen/factorio ``` Where [PATH] is the path to the folder with your mods. -#### Allowing in-game commands -I've always disabled in-game commands because I think it is like cheating, however, you can enable them by setting the the "FACTORIO_DISSALOW_COMMANDS" variable to "false". + +### Allowing in-game commands + +I've always disabled in-game commands because I think it is like cheating, however, you can enable them by setting the the `FACTORIO_DISSALOW_COMMANDS` variable to "false". ``` docker run -d \ --env FACTORIO_DISSALOW_COMMANDS=false \ -p [PORT]:34197/udp \ dtandersen/factorio ``` -#### Activating no-auto-pause in the game when no one is on the server -I do not recommend this feature, bud it can make the game more difficult if you're up for a challenge :-). Just set the "FACTORIO_NO_AUTO_PAUSE" variable to "true". + +### Activating no-auto-pause in the game when no one is on the server + +I do not recommend this feature, bud it can make the game more difficult if you're up for a challenge :-). Just set the `FACTORIO_NO_AUTO_PAUSE` variable to "true". ``` docker run -d \ --env FACTORIO_NO_AUTO_PAUSE=true \ @@ -112,6 +122,6 @@ docker run -d \ dtandersen/factorio ``` -### Credits +# Credits Based on [Zopanix' Factorio Server](https://github.com/zopanix/docker_factorio_server). From d4052bc7903148f05dc89e7653bacd17ff4026f2 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:50:29 -0700 Subject: [PATCH 13/34] formatted the word dockerfile as code --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 33d91f5..a821d81 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Supported tags and respective Dockerfile links +# Supported tags and respective `Dockerfile` links * `0.12.30`, `latest` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/master/Dockerfile) From 14bbd68a3bc0e5f295a16e9eae7f9fe8bf9c001b Mon Sep 17 00:00:00 2001 From: David Andersen Date: Thu, 14 Apr 2016 22:54:17 -0700 Subject: [PATCH 14/34] how to see logs --- README.md | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index a821d81..0f8efa3 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ The game is very stable and optimized for building massive factories. You can cr NOTE: This is only the server. The game is available on [Steam](http://store.steampowered.com/app/427520/). # Features + * Automatically takes latest save or autosave when restarting the container. * Volumes for saves and mods * Set autosave interval and number of saves. @@ -34,6 +35,7 @@ docker run -d \ -p [PORT]:34197/udp \ dtandersen/factorio ``` + * Where [PATH] is a folder where you'll put your saves, if there already is a save in it with the string "save", that one will be taken by default, otherwize, a new one will be made. * Where [PORT] is the port number you choose, if you're going to launch it on your local machine, don't use the port 34197, take another one at random. @@ -41,70 +43,80 @@ docker run -d \ ### Without map persistence +This will generate a new random map with default settings. + ``` docker run -d \ -p [PORT]:34197/udp \ dtandersen/factorio ``` -This will generate a new random map with default settings. ### With map persistence -``` -docker run -d \ - -v [PATH]:/opt/factorio/saves \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` This will generate a new random map with default settings and save it onto the volume. Replace [PATH] with a path to a folder on the host where the map will be saved. +``` +docker run -d \ + -v [PATH]:/opt/factorio/saves \ + -p [PORT]:34197/udp \ + dtandersen/factorio +``` + ### With existing map +It's the same as above, it takes the last modified file which contains the word save in the filename as current save when booting the server. This allows when upgrading the container to take the last save, you don't have to rename the last autosave as save.zip + ``` docker run -d \ -v [PATH]:/opt/factorio/saves \ -p [PORT]:34197/udp \ dtandersen/factorio ``` -It's the same as above, it takes the last modified file which contains the word save in the filename as current save when booting the server. This allows when upgrading the container to take the last save, you don't have to rename the last autosave as save.zip ### Autosave interval You can set the autosave interval. By default it is set at 2 minutes bud you can change it by launching the container with the `FACTORIO_AUTOSAVE_INTERVAL` variable to whatever suits you best. + ``` docker run -d \ --env FACTORIO_AUTOSAVE_INTERVAL=[NUMBER] \ -p [PORT]:34197/udp \ dtandersen/factorio ``` + Where [NUMBER] is the number of minutes between autosaves. ### Autosave slots You can set the number of autosave slots. By default it is set at 3 slots bud you can change it by launching the container with the `FACTORIO_AUTOSAVE_SLOTS` variable to whatever suits you best. + ``` docker run -d \ --env FACTORIO_AUTOSAVE_SLOTS=[NUMBER] \ -p [PORT]:34197/udp \ dtandersen/factorio ``` + Where [NUMBER] is the number of autosave slots. ### Mounting mod volume As everybody knows about factorio is you can add mods to it. Now you can also do it in this docker image by mounting a volume. + ``` docker run -d \ -v [PATH]:/opt/factorio/mods \ -p [PORT]:34197/udp \ dtandersen/factorio ``` + Where [PATH] is the path to the folder with your mods. ### Allowing in-game commands I've always disabled in-game commands because I think it is like cheating, however, you can enable them by setting the the `FACTORIO_DISSALOW_COMMANDS` variable to "false". + ``` docker run -d \ --env FACTORIO_DISSALOW_COMMANDS=false \ @@ -115,6 +127,7 @@ docker run -d \ ### Activating no-auto-pause in the game when no one is on the server I do not recommend this feature, bud it can make the game more difficult if you're up for a challenge :-). Just set the `FACTORIO_NO_AUTO_PAUSE` variable to "true". + ``` docker run -d \ --env FACTORIO_NO_AUTO_PAUSE=true \ @@ -122,6 +135,14 @@ docker run -d \ dtandersen/factorio ``` +### Logs + +Sometimes it's useful to see the logs of a running container: + +``` +docker exec -it [CONTAINER] tail -f /opt/factorio/factorio-current.log +``` + # Credits Based on [Zopanix' Factorio Server](https://github.com/zopanix/docker_factorio_server). From a4a482ee912829a62c6b01f571d7468f819dcfdb Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 26 Apr 2016 15:01:32 -0700 Subject: [PATCH 15/34] updated dockerfile links --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3612835..9046569 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Supported tags and respective `Dockerfile` links -* `0.12.31`, `latest` [(0.12.31/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_develop/Dockerfile) -* `0.12.30` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_develop/Dockerfile) +* `0.12.31`, `latest` [(0.12.31/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.31/Dockerfile) +* `0.12.30` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.30/Dockerfile) [![](https://badge.imagelayers.io/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') From 1d3fc75d204b0d24d673a311ab9321cc07ad5b9e Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 26 Apr 2016 15:05:59 -0700 Subject: [PATCH 16/34] updated imagelayers.io badge url --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9046569..e6b1b91 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ * `0.12.31`, `latest` [(0.12.31/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.31/Dockerfile) * `0.12.30` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.30/Dockerfile) -[![](https://badge.imagelayers.io/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') +[![](https://imagelayers.io/badge/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') # What is Factorio? From 15da4f79f59c57668056a541d7bfb275b30ac30a Mon Sep 17 00:00:00 2001 From: David Andersen Date: Fri, 29 Apr 2016 15:51:47 -0700 Subject: [PATCH 17/34] updated version and sha1 for 0.12.32 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e4ab4c3..db32806 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ ENV FACTORIO_AUTOSAVE_INTERVAL=2 \ FACTORIO_AUTOSAVE_SLOTS=3 \ FACTORIO_DISSALOW_COMMANDS=true \ FACTORIO_NO_AUTO_PAUSE=false \ - VERSION=0.12.31 \ - FACTORIO_SHA1=2b225302bcea95d541da9057f05acc3d27b0fe79 + VERSION=0.12.32 \ + FACTORIO_SHA1=ce3ebfd819ae335f71f1ac68dbd6b1962bbd1df0 RUN apk --update 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 && \ From ec17a32638ccb57250603a355f5d2db53f8b4af0 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Fri, 29 Apr 2016 15:56:19 -0700 Subject: [PATCH 18/34] updated readme for 0.12.32 --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e6b1b91..2b80cbf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Supported tags and respective `Dockerfile` links -* `0.12.31`, `latest` [(0.12.31/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.31/Dockerfile) +* `0.12.32`, `latest` [(0.12.32/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.32/Dockerfile) +* `0.12.31` [(0.12.31/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.31/Dockerfile) * `0.12.30` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.30/Dockerfile) [![](https://imagelayers.io/badge/dtandersen/factorio:latest.svg)](https://imagelayers.io/?images=dtandersen/factorio:latest 'Get your own badge on imagelayers.io') From a2ebf4db2d08f23e4abdd425a8e73737d350c3fd Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 15:51:34 +0000 Subject: [PATCH 19/34] updated to 0.14.14 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index db32806..1e2a151 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ ENV FACTORIO_AUTOSAVE_INTERVAL=2 \ FACTORIO_AUTOSAVE_SLOTS=3 \ FACTORIO_DISSALOW_COMMANDS=true \ FACTORIO_NO_AUTO_PAUSE=false \ - VERSION=0.12.32 \ - FACTORIO_SHA1=ce3ebfd819ae335f71f1ac68dbd6b1962bbd1df0 + VERSION=0.14.14 \ + FACTORIO_SHA1=decd1ef34a75b309791e65bc92b164f10479753b RUN apk --update 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 && \ From aca4709d7faf048b6ec2836463ed02523f653c10 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 16:49:23 +0000 Subject: [PATCH 20/34] use server-settings.json for settings --- Dockerfile | 27 ++++++++++++--------------- smart_launch.sh | 42 +++++++----------------------------------- 2 files changed, 19 insertions(+), 50 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1e2a151..de7c061 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,25 @@ FROM frolvlad/alpine-glibc:alpine-3.3_glibc-2.23 -MAINTAINER zopanix +MAINTAINER https://github.com/dtandersen/docker_factorio_server -WORKDIR /opt +#WORKDIR /opt -COPY ./smart_launch.sh /opt -COPY ./factorio.crt /opt +COPY ./factorio.crt /opt/factorio.crt -VOLUME /opt/factorio/saves /opt/factorio/mods +EXPOSE 34197/udp 27015/tcp -ENV FACTORIO_AUTOSAVE_INTERVAL=2 \ - FACTORIO_AUTOSAVE_SLOTS=3 \ - FACTORIO_DISSALOW_COMMANDS=true \ - FACTORIO_NO_AUTO_PAUSE=false \ - VERSION=0.14.14 \ - FACTORIO_SHA1=decd1ef34a75b309791e65bc92b164f10479753b + +ENV VERSION=0.14.14 \ + SHA1=decd1ef34a75b309791e65bc92b164f10479753b RUN apk --update 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 "$FACTORIO_SHA1 /tmp/factorio_headless_x64_$VERSION.tar.gz" | sha1sum -c && \ - tar xzf /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 +VOLUME /opt/factorio/saves /opt/factorio/mods -EXPOSE 34197/udp +COPY ./smart_launch.sh /opt -CMD ["./smart_launch.sh"] +CMD ["/opt/smart_launch.sh"] diff --git a/smart_launch.sh b/smart_launch.sh index dac61f8..8ddb057 100755 --- a/smart_launch.sh +++ b/smart_launch.sh @@ -1,43 +1,15 @@ -#!/bin/bash +#!/bin/bash -x -if [ -f /opt/factorio/saves/save.zip ] +SAVES=/opt/factorio/saves + +if [ -f $SAVES/*.zip ] then - echo "###" - echo "# Using existing map [save.zip]" - echo "###" - echo "###" - echo "# Finding latest map" - echo "###" - last_save=$(ls /opt/factorio/saves -lt | grep save |head -1 |awk '{print $(NF)}') + last_save=$(ls $SAVES -lt | grep save |head -1 |awk '{print $(NF)}') else - echo "###" - echo "# Creating a new map [save.zip]" - echo "###" - /opt/factorio/bin/x64/factorio --create save.zip last_save="save.zip" - echo "###" - echo "# New map created [save.zip]" - echo "###" + /opt/factorio/bin/x64/factorio --create $SAVES/$last_save fi -# Checking options -if [ "$FACTORIO_DISSALOW_COMMANDS" == false ]; then - disallow_commands="" -else - disallow_commands="--disallow-commands" -fi -if [ "$FACTORIO_NO_AUTO_PAUSE" == true ]; then - no_auto_pause="--no-auto-pause" -else - no_auto_pause="" -fi -echo "###" -echo "# Launching Game" -echo "###" exec /opt/factorio/bin/x64/factorio \ - $disallow_commands \ - $no_auto_pause \ - --autosave-interval ${FACTORIO_AUTOSAVE_INTERVAL} \ - --autosave-slots ${FACTORIO_AUTOSAVE_SLOTS} \ --start-server \ - $last_save + $SAVES/$last_save From 8d90253929cba086368d68258d2a8b4a2af24b74 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 16:58:54 +0000 Subject: [PATCH 21/34] update readme --- README.md | 112 +++++++----------------------------------------------- 1 file changed, 14 insertions(+), 98 deletions(-) diff --git a/README.md b/README.md index 2b80cbf..a01557c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Supported tags and respective `Dockerfile` links +* `0.14.14` [(0.14.14/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/0.14.14/Dockerfile) * `0.12.32`, `latest` [(0.12.32/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.32/Dockerfile) * `0.12.31` [(0.12.31/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.31/Dockerfile) * `0.12.30` [(0.12.30/Dockerfile)](https://github.com/dtandersen/docker_factorio_server/blob/dt_0.12.30/Dockerfile) @@ -29,113 +30,28 @@ NOTE: This is only the server. The game is available on [Steam](http://store.ste ## Quick Start -This runs factorio with default settings, and your save will be kept: +Create ```server-config.json``` and modify it to your liking. Now run: ``` -docker run -d \ - -v [PATH]:/opt/factorio/saves \ - -p [PORT]:34197/udp \ +docker run -d -P \ + -v /path/to/server-config.json:/opt/factorio/data/server-config.json \ + -v /path/to/saves:/opt/factorio/saves \ + -v /path/to/mods:/opt/factorio/mods \ dtandersen/factorio ``` -* Where [PATH] is a folder where you'll put your saves, if there already is a save in it with the string "save", that one will be taken by default, otherwize, a new one will be made. -* Where [PORT] is the port number you choose, if you're going to launch it on your local machine, don't use the port 34197, take another one at random. +The server should start and create ```/path/to/saves/save.zip```. This save is used when the server is restarted. -## Advanced usage +## Volumes -### Without map persistence +* /opt/factorio/saves - save files +* /opt/factorio/mods - save files +* /opt/factorio/data/server-config.json - config file -This will generate a new random map with default settings. +## Ports -``` -docker run -d \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -### With map persistence - -This will generate a new random map with default settings and save it onto the volume. -Replace [PATH] with a path to a folder on the host where the map will be saved. - -``` -docker run -d \ - -v [PATH]:/opt/factorio/saves \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -### With existing map - -It's the same as above, it takes the last modified file which contains the word save in the filename as current save when booting the server. This allows when upgrading the container to take the last save, you don't have to rename the last autosave as save.zip - -``` -docker run -d \ - -v [PATH]:/opt/factorio/saves \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -### Autosave interval - -You can set the autosave interval. By default it is set at 2 minutes bud you can change it by launching the container with the `FACTORIO_AUTOSAVE_INTERVAL` variable to whatever suits you best. - -``` -docker run -d \ - --env FACTORIO_AUTOSAVE_INTERVAL=[NUMBER] \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -Where [NUMBER] is the number of minutes between autosaves. - -### Autosave slots - -You can set the number of autosave slots. By default it is set at 3 slots bud you can change it by launching the container with the `FACTORIO_AUTOSAVE_SLOTS` variable to whatever suits you best. - -``` -docker run -d \ - --env FACTORIO_AUTOSAVE_SLOTS=[NUMBER] \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -Where [NUMBER] is the number of autosave slots. - -### Mounting mod volume - -As everybody knows about factorio is you can add mods to it. Now you can also do it in this docker image by mounting a volume. - -``` -docker run -d \ - -v [PATH]:/opt/factorio/mods \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -Where [PATH] is the path to the folder with your mods. - -### Allowing in-game commands - -I've always disabled in-game commands because I think it is like cheating, however, you can enable them by setting the the `FACTORIO_DISSALOW_COMMANDS` variable to "false". - -``` -docker run -d \ - --env FACTORIO_DISSALOW_COMMANDS=false \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` - -### Activating no-auto-pause in the game when no one is on the server - -I do not recommend this feature, bud it can make the game more difficult if you're up for a challenge :-). Just set the `FACTORIO_NO_AUTO_PAUSE` variable to "true". - -``` -docker run -d \ - --env FACTORIO_NO_AUTO_PAUSE=true \ - -p [PORT]:34197/udp \ - dtandersen/factorio -``` +* 34197/udp - game data +* 27015/tcp - rcon ### Logs From 4a48f9234f01af1c60611e6fb574a1ce5fe75c96 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 17:03:50 +0000 Subject: [PATCH 22/34] updated readme --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a01557c..bd87450 100644 --- a/README.md +++ b/README.md @@ -37,9 +37,12 @@ docker run -d -P \ -v /path/to/server-config.json:/opt/factorio/data/server-config.json \ -v /path/to/saves:/opt/factorio/saves \ -v /path/to/mods:/opt/factorio/mods \ + --name factorio dtandersen/factorio ``` +```-d``` starts the server as a daemon. ```-P``` exposes all ports. The ```-v``` options mount volumes on the local file system to the container for config, mods, and saves. ```dtandersen/factorio``` is the docker images name. ```--name``` gives the container a name instead of a random name. + The server should start and create ```/path/to/saves/save.zip```. This save is used when the server is restarted. ## Volumes @@ -58,7 +61,7 @@ The server should start and create ```/path/to/saves/save.zip```. This save is u Sometimes it's useful to see the logs of a running container: ``` -docker exec -it [CONTAINER] tail -f /opt/factorio/factorio-current.log +docker exec -it factorio tail -f /opt/factorio/factorio-current.log ``` # Credits From f3b4d8e4451fd54e33297c09c4b96733cc4e889f Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 10:11:09 -0700 Subject: [PATCH 23/34] example config --- server-settings.example.json | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 server-settings.example.json diff --git a/server-settings.example.json b/server-settings.example.json new file mode 100644 index 0000000..511a7f3 --- /dev/null +++ b/server-settings.example.json @@ -0,0 +1,54 @@ +{ + "name": "Name of the game as it will appear in the game listing", + "description": "Description of the game that will appear in the listing", + "tags": ["game", "tags"], + + "_comment_max_players": "Maximum number of players allowed, admins can join even a full server. 0 means unlimited.", + "max_players": 0, + + "_comment_visibility": ["public: Game will be published on the official Factorio matching server", + "lan: Game will be broadcast on LAN", + "hidden: Game will not be published anywhere"], + "visibility": "public", + + "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public", + "username": "", + "password": "", + + "_comment_token": "Authentication token. May be used instead of 'password' above.", + "token": "", + + "game_password": "", + + "_comment_require_user_verification": "When set to true, the server will only allow clients that have a valid Factorio.com account", + "require_user_verification": true, + + "_comment_max_upload_in_kilobytes_per_second" : "optional, default value is 0. 0 means unlimited.", + "max_upload_in_kilobytes_per_second": 0, + + "_comment_ignore_player_limit_for_returning_players": "Players that played on this map already can join even when the max player limit was reached.", + "ignore_player_limit_for_returning_players": false, + + "_comment_allow_commands": "possible values are, true, false and admins-only", + "allow_commands": "admins-only", + + "_comment_autosave_interval": "Autosave interval in minutes", + "autosave_interval": 10, + + "_comment_autosave_slots": "server autosave slots, it is cycled through when the server autosaves.", + "autosave_slots": 5, + + "_comment_afk_autokick_interval": "How many minutes until someone is kicked when doing nothing, 0 for never.", + "afk_autokick_interval": 0, + + "_comment_auto_pause": "Whether should the server be paused when no players are present.", + "auto_pause": true, + + "only_admins_can_pause_the_game": true, + + "_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.", + "autosave_only_on_server": true, + + "_comment_admins": "List of case insensitive usernames, that will be promoted immediately", + "admins": [] +} From b85b998062d08ffbbe5076aa021e9e34b379800b Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 10:28:04 -0700 Subject: [PATCH 24/34] doc update --- README.md | 54 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index bd87450..2afcc6d 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,18 @@ NOTE: This is only the server. The game is available on [Steam](http://store.ste # Features -* Automatically takes latest save or autosave when restarting the container. -* Volumes for saves and mods -* Set autosave interval and number of saves. -* Enable/disable the no-auto-pause option. -* Enable/disable console commands in game. -* Based on Alpine Linux. +* Configurable via ```server-config.json```. +* Automatically loads the last save. +* Volumes for saves and mods. +* Small size. Based on Alpine Linux. # How to use this image? ## Quick Start -Create ```server-config.json``` and modify it to your liking. Now run: +Create ```server-config.json``` and modify it to your liking. + +Now start the server: ``` docker run -d -P \ @@ -41,22 +41,46 @@ docker run -d -P \ dtandersen/factorio ``` -```-d``` starts the server as a daemon. ```-P``` exposes all ports. The ```-v``` options mount volumes on the local file system to the container for config, mods, and saves. ```dtandersen/factorio``` is the docker images name. ```--name``` gives the container a name instead of a random name. +If you're wondering what all these options are: -The server should start and create ```/path/to/saves/save.zip```. This save is used when the server is restarted. +* ```-d``` - Start the server as a daemon. +* ```-P``` - Expose all ports. +* ```-v``` - Mount volumes for config, mods, and saves. +* ```--name``` - Give the container a name (otherwise it'll be random). +* ```dtandersen/factorio``` - The Docker image name. + +The server should start and create ```/path/to/saves/save.zip```. The save remains if the server stops, since the save folder is mounted as a volume. + +## Stopping the Server + +Assuming the server is named ```factorio```, run: + +``` +docker stop factorio +``` + +## Saves + +If there are no saves when the server starts, then a new map is generated and saved as ```save.zip```. + +Otherwise, the most recent ZIP file in the saves folder is used. To load an old save ```touch save.zip``` and restart the server. + +## Mods + +Copy them into the mods folder. ## Volumes -* /opt/factorio/saves - save files -* /opt/factorio/mods - save files -* /opt/factorio/data/server-config.json - config file +* ```/opt/factorio/saves``` - Saves (recommened) +* ```/opt/factorio/mods``` - Mods (optional) +* ```/opt/factorio/data/server-config.json``` - Configuration (recommended) ## Ports -* 34197/udp - game data -* 27015/tcp - rcon +* ```34197/udp``` - Client (required) +* ```27015/tcp``` - Remote console (optional) -### Logs +## Logs Sometimes it's useful to see the logs of a running container: From 8e1a0441721e76530a131fa0b19a8e001439fbbb Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 18:02:33 +0000 Subject: [PATCH 25/34] update alpine --- Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index de7c061..d4da0b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,25 @@ -FROM frolvlad/alpine-glibc:alpine-3.3_glibc-2.23 +FROM frolvlad/alpine-glibc:alpine-3.4 MAINTAINER https://github.com/dtandersen/docker_factorio_server -#WORKDIR /opt - COPY ./factorio.crt /opt/factorio.crt -EXPOSE 34197/udp 27015/tcp - - ENV VERSION=0.14.14 \ SHA1=decd1ef34a75b309791e65bc92b164f10479753b RUN apk --update 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 && \ + 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 + VOLUME /opt/factorio/saves /opt/factorio/mods COPY ./smart_launch.sh /opt +EXPOSE 34197/udp 27015/tcp + CMD ["/opt/smart_launch.sh"] From 9261339510a9a735a9fe1dd34490bd938327bce1 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 18:30:24 +0000 Subject: [PATCH 26/34] simplify startup --- smart_launch.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/smart_launch.sh b/smart_launch.sh index 8ddb057..8040453 100755 --- a/smart_launch.sh +++ b/smart_launch.sh @@ -2,14 +2,9 @@ SAVES=/opt/factorio/saves -if [ -f $SAVES/*.zip ] +if [ ! -f $SAVES/*.zip ] then - last_save=$(ls $SAVES -lt | grep save |head -1 |awk '{print $(NF)}') -else - last_save="save.zip" - /opt/factorio/bin/x64/factorio --create $SAVES/$last_save + /opt/factorio/bin/x64/factorio --create $SAVES/save.zip fi -exec /opt/factorio/bin/x64/factorio \ - --start-server \ - $SAVES/$last_save +exec /opt/factorio/bin/x64/factorio --start-server-load-latest From 1dbac7408f0df60c2365d9174a9cb0b427a61430 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 18:31:07 +0000 Subject: [PATCH 27/34] utility script --- build.sh | 1 + run.sh | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100755 build.sh create mode 100755 run.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a9e8f77 --- /dev/null +++ b/build.sh @@ -0,0 +1 @@ +sudo docker build -t factorio . diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..e0805ac --- /dev/null +++ b/run.sh @@ -0,0 +1,6 @@ +sudo docker run --rm -it \ + -v /home/vagrant/docker_factorio_server/server-settings.json:/opt/factorio/data/server-settings.json \ + -v /data/mods:/opt/factorio/mods \ + -v /data/saves:/opt/factorio/saves \ + --name factorio \ + factorio From fc42bf78637272fc9ed430b9761a4b11a287dd9d Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 18:39:28 +0000 Subject: [PATCH 28/34] rename entrypoint --- Dockerfile | 5 ++--- smart_launch.sh => docker-entrypoint.sh | 0 2 files changed, 2 insertions(+), 3 deletions(-) rename smart_launch.sh => docker-entrypoint.sh (100%) diff --git a/Dockerfile b/Dockerfile index d4da0b3..5666f92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,9 +17,8 @@ RUN apk --update add bash curl && \ VOLUME /opt/factorio/saves /opt/factorio/mods -COPY ./smart_launch.sh /opt - EXPOSE 34197/udp 27015/tcp -CMD ["/opt/smart_launch.sh"] +COPY ./docker-entrypoint.sh / +CMD ["/docker-entrypoint.sh"] diff --git a/smart_launch.sh b/docker-entrypoint.sh similarity index 100% rename from smart_launch.sh rename to docker-entrypoint.sh From 05a3ca45e4a58723a79e91b92368ce69dbeab7bb Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 11:40:53 -0700 Subject: [PATCH 29/34] typo --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2afcc6d..394d750 100644 --- a/README.md +++ b/README.md @@ -37,17 +37,17 @@ docker run -d -P \ -v /path/to/server-config.json:/opt/factorio/data/server-config.json \ -v /path/to/saves:/opt/factorio/saves \ -v /path/to/mods:/opt/factorio/mods \ - --name factorio + --name factorio \ dtandersen/factorio ``` If you're wondering what all these options are: -* ```-d``` - Start the server as a daemon. -* ```-P``` - Expose all ports. -* ```-v``` - Mount volumes for config, mods, and saves. +* ```-d``` - Start the server as a daemon. +* ```-P``` - Expose all ports. +* ```-v``` - Mount volumes for config, mods, and saves. * ```--name``` - Give the container a name (otherwise it'll be random). -* ```dtandersen/factorio``` - The Docker image name. +* ```dtandersen/factorio``` - The Docker image name. The server should start and create ```/path/to/saves/save.zip```. The save remains if the server stops, since the save folder is mounted as a volume. From 3f8621f89686198dd44cc948d9d6df8bae73e028 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 11:59:50 -0700 Subject: [PATCH 30/34] update docs --- README.md | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 394d750..c6acc2d 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,21 @@ NOTE: This is only the server. The game is available on [Steam](http://store.ste ## Quick Start -Create ```server-config.json``` and modify it to your liking. +Start the server in interactive mode for debugging. The game isn't saved. -Now start the server: +``` +docker run --rm -it -P dtandersen/factorio +``` + +* ```--rm``` - Remove container after stopping +* ```-it``` - Interactive mode, i.e. you can see the console +* ```-P``` - Expose all ports. + +## Usage + +Normally the server runs as a daemon and a configuration file is specified. Volumes are mounted for saves and mods. + +Create ```server-config.json``` and modify it to your liking. ``` docker run -d -P \ @@ -41,33 +53,32 @@ docker run -d -P \ dtandersen/factorio ``` -If you're wondering what all these options are: - * ```-d``` - Start the server as a daemon. * ```-P``` - Expose all ports. * ```-v``` - Mount volumes for config, mods, and saves. * ```--name``` - Give the container a name (otherwise it'll be random). -* ```dtandersen/factorio``` - The Docker image name. -The server should start and create ```/path/to/saves/save.zip```. The save remains if the server stops, since the save folder is mounted as a volume. +## Saves -## Stopping the Server +The first time the server is started a new map is generated and saved as ```save.zip```. On subsequent runs the newest save is used. To load an old save ```touch save.zip``` and restart the server. -Assuming the server is named ```factorio```, run: +## Mods + +Copy them into the mods folder and restart the server. + +## Start/Stopping + +Assuming the server is named ```factorio```, to stop the server: ``` docker stop factorio ``` -## Saves +To restart the server: -If there are no saves when the server starts, then a new map is generated and saved as ```save.zip```. - -Otherwise, the most recent ZIP file in the saves folder is used. To load an old save ```touch save.zip``` and restart the server. - -## Mods - -Copy them into the mods folder. +``` +docker start factorio +``` ## Volumes From 1e97a953023906eac5f5462dc5f21567184ebdac Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 19:30:12 +0000 Subject: [PATCH 31/34] removed exec --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8040453..9e63006 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,4 +7,4 @@ then /opt/factorio/bin/x64/factorio --create $SAVES/save.zip fi -exec /opt/factorio/bin/x64/factorio --start-server-load-latest +/opt/factorio/bin/x64/factorio --start-server-load-latest From 47d6cfb2b15d9de528e859979294b371e3799db8 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 12:33:45 -0700 Subject: [PATCH 32/34] add back exec --- docker-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 9e63006..8040453 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -7,4 +7,4 @@ then /opt/factorio/bin/x64/factorio --create $SAVES/save.zip fi -/opt/factorio/bin/x64/factorio --start-server-load-latest +exec /opt/factorio/bin/x64/factorio --start-server-load-latest From f2c9fbb10cfce606391a9f40f6d12b4495a802dd Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 13:34:55 -0700 Subject: [PATCH 33/34] update example config --- server-settings.example.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/server-settings.example.json b/server-settings.example.json index 511a7f3..5b2a68c 100644 --- a/server-settings.example.json +++ b/server-settings.example.json @@ -7,9 +7,12 @@ "max_players": 0, "_comment_visibility": ["public: Game will be published on the official Factorio matching server", - "lan: Game will be broadcast on LAN", - "hidden: Game will not be published anywhere"], - "visibility": "public", + "lan: Game will be broadcast on LAN"], + "visibility": + { + "public": true, + "lan": true + }, "_comment_credentials": "Your factorio.com login credentials. Required for games with visibility public", "username": "", @@ -45,7 +48,7 @@ "auto_pause": true, "only_admins_can_pause_the_game": true, - + "_comment_autosave_only_on_server": "Whether autosaves should be saved only on server or also on all connected clients. Default is true.", "autosave_only_on_server": true, From d88da771e9fe4214d6ac3185281a1cfa106965a5 Mon Sep 17 00:00:00 2001 From: David Andersen Date: Tue, 25 Oct 2016 13:35:32 -0700 Subject: [PATCH 34/34] update checksum --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5666f92..50fca14 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,8 @@ MAINTAINER https://github.com/dtandersen/docker_factorio_server COPY ./factorio.crt /opt/factorio.crt -ENV VERSION=0.14.14 \ - SHA1=decd1ef34a75b309791e65bc92b164f10479753b +ENV VERSION=0.14.16 \ + SHA1=e27c658bf8a7579b662a1c34815daa223e57bc90 RUN apk --update add bash curl && \ curl -sSL --cacert /opt/factorio.crt \