Compare commits

...

206 Commits

Author SHA1 Message Date
be7ecddb0d update to 0.17.48 2019-06-11 14:14:13 +00:00
43599d0c23 update to 0.17.47 2019-06-07 15:49:12 +00:00
6fb4cbc600 update to 0.17.46 2019-06-07 11:19:11 +00:00
fe0e8f9b91 update to 0.17.45 2019-05-31 13:14:12 +00:00
f76e88cea1 update to 0.17.44 2019-05-30 15:14:11 +00:00
cbaa20cdea CI: Do not try to push master 2019-05-25 23:49:55 +02:00
b3c134d396 update to 0.17.43 2019-05-24 13:09:12 +00:00
9bdb79b494 CI: Do not try to push master 2019-05-21 22:37:26 +02:00
77d83b4152 update to 0.17.42 2019-05-21 17:09:12 +00:00
25d4edf14f CI: Don't push $TRAVIS_BRANCH if it is equal to $VERSIOn
Reason behind that is that git tags have $TRAVIS_BRANCH set to the tag name
2019-05-18 14:07:27 +02:00
e16b111c0b CI: Tag Docker Image with $VERSION_SHORT on git tag building 2019-05-18 14:01:22 +02:00
09e1ad2045 CI: another try to fix tag building 2019-05-18 13:40:25 +02:00
2efa39084f Cache shields.io badges for 10m 2019-05-18 13:37:51 +02:00
77edb05109 CI: try fix tag building, fix upload, add easy manual pushing, more fixes 2019-05-18 13:26:04 +02:00
2eea2a25e4 CI: correct docker hub repo name 2019-05-17 19:57:33 +02:00
98ea8a27c1 Fix sha1 of 0.17.41
Closes #261
2019-05-17 19:45:29 +02:00
956af65a2b update to 0.17.41 2019-05-17 11:19:10 +00:00
b5c1dff7b4 Allow puid/pgid to be set as environment vars on stable (#256)
* allow puid/pgid to be set on stable

* update docker-entrypoint to include puid, gpid

* add quotes to env puid/pgid env vars

* add quotes for factorio-vol
2019-05-17 12:32:55 +02:00
ee5b023911 Quote all vars in Dockerfile (#259) 2019-05-17 09:11:09 +02:00
045ef7a214 Skip docker push if it is a PR 2019-05-16 20:19:36 +02:00
bbc2d42302 Compare $VERSION_SHORT wether we need to push the image 2019-05-16 20:04:24 +02:00
0173eab54c Quote factorio volume variable 2019-05-16 19:59:42 +02:00
f868aa16ad Follow up to #255 2019-05-16 19:55:43 +02:00
5cd0c40975 fix for .tmp.zip saves not being deleted on start (#255)
Co-Authored-By: Chris Cowan <agentme49@gmail.com>
2019-05-16 19:55:02 +02:00
778d982c6d CI: Actually check the entire array 2019-05-16 19:43:44 +02:00
9d2c38df65 CI: Fix version detection of which image to push, actually push the image 2019-05-16 19:39:50 +02:00
b2a4195e13 Advance CI features (#245)
* Build feature branches with branch tag

* Build short and long image tag

* Add latest and stable tag, made moving repos easier

* Only push tags to registry

* Only build tags that where changed

* Fix if and quoting, push $VERSION_SHORT

* Update MicroBadger with Webhook, closes #251

* Quote vars

* Set tag on PR, too

* Switch to hadolint docker image

due to PR not having enviroment variables and I don't want to commit my token in the script

* Only push image on master
2019-05-16 19:23:07 +02:00
18ccac666d update to 0.17.40 2019-05-16 15:59:12 +00:00
830d042e4b Add me (SuperSandro2000) to the Contributors list 2019-05-15 20:05:36 +02:00
a0868ba653 Added build status & latest dockerhub version 2019-05-15 13:26:00 +02:00
7002778ab5 Updated urls 2019-05-15 13:07:30 +02:00
44371283b6 update to 0.17.39 2019-05-14 15:49:11 +00:00
d421adab67 update to 0.17.38 2019-05-10 14:39:11 +00:00
b0cedbbe1b Update docker-entrypoint.sh (#253) 2019-05-10 01:27:25 +02:00
010b96e0b0 update to 0.17.37 2019-05-07 16:29:12 +00:00
621ccf4282 Fixed naming of $SCENARIOS (#242)
Fixed naming of `$SCENARIOS`
2019-05-04 16:18:06 +02:00
1204b97fca update to 0.17.36 2019-05-03 16:29:13 +00:00
aef16e83a7 Fixed naming of $SCENARIOS
Renamed local variable `$SCENARIO` to `$SERVER_SCENARIO`
2019-05-02 12:07:38 -04:00
605ca74c0e Add travis ci, linter, merge shellcheck, fix some issues (#241)
* Quote all vars, remove useless echo/sub-shell, add shebands, fail on unset vars, enable pipefail, formatting

* Add CI including linting via hadolint nad shellcheck

* Update all base images to tag 3.9

* Switch to maintainer labels

* Quote vars

* Remove commented code

* Ignore if the folder exists
2019-05-02 17:28:20 +02:00
e34180ca51 update to 0.17.35 2019-05-02 14:34:11 +00:00
0db1dde077 Updated readme with new dockerhub links & updated version to 0.17 2019-05-02 13:10:51 +02:00
e8aeb461a9 Quote all vars, remove useless echo/sub-shell, add shebands, formatting (#226) 2019-05-02 14:53:26 +10:00
46f24b0b7a Quote all vars, remove useless echo/sub-shell, add shebands, fail on unset vars, enable pipefail, formatting 2019-05-01 10:04:56 +02:00
6d92825f56 Add AWS deployment repo Link (#235) 2019-04-29 08:23:24 +10:00
55fdc2e0de Remove reference to 0.13 path, fix spelling issues (#238) 2019-04-28 12:07:29 +02:00
57c9f59f46 Add AWS deployment repo Link. 2019-04-28 11:05:44 +10:00
8f15b73d7b update to 0.17.34 2019-04-26 15:04:11 +00:00
ecc54400ba update to 0.17.33 2019-04-24 17:19:11 +00:00
eea1d550f2 Fix conflicting user group ids (#232) 2019-04-21 12:15:01 +02:00
730b2c334b update to 0.17.32 2019-04-18 11:29:11 +00:00
288f080ebc Add support for changing UID/GID (#216)
* Add support for changing UID/GID

* Revert volume definition in docker-compose file
2019-04-18 13:00:14 +02:00
2ffac3c4a8 update to 0.17.31 2019-04-12 22:14:12 +00:00
88fed15bb4 update to 0.17.30 2019-04-12 17:09:11 +00:00
968fb8a3bd update to 0.17.29 2019-04-12 12:29:11 +00:00
9d642d8fb0 update to 0.17.28 2019-04-09 19:14:11 +00:00
4c3818b27c update to 0.17.26 2019-04-08 18:34:12 +00:00
a6d480d695 update to 0.17.25 2019-04-04 19:04:12 +00:00
fce556160a update to 0.17.24 2019-04-02 17:39:13 +00:00
4727f62a8f update to 0.17.23 2019-03-29 16:58:35 +00:00
64cbf48082 update to 0.17.22 2019-03-29 12:43:35 +00:00
dd6bc76827 update to 0.17.21 2019-03-26 20:48:35 +00:00
b7108c64cb update to 0.17.20 2019-03-26 16:53:35 +00:00
2f53d7e03c update to 0.17.19 2019-03-26 14:58:35 +00:00
f97eee5f83 update to 0.17.18 2019-03-25 18:28:35 +00:00
0e1808c3f5 update to 0.17.17 2019-03-21 19:53:34 +00:00
629a3fade3 removed 0.13 2019-03-20 10:20:44 -07:00
3f88bcbf52 update to 0.17.16 2019-03-19 21:53:35 +00:00
fb36aaa0d9 update to 0.17.15 2019-03-18 20:33:35 +00:00
e22ce8989b update to 0.17.14 2019-03-15 20:23:35 +00:00
29f3e54adf Merge pull request #220 from MagicHack/master
Update to 0.17.13
2019-03-15 20:01:54 +01:00
148de89c52 Update to 0.17.13 2019-03-15 14:51:21 -04:00
4fc8da6581 Merge pull request #217 from MagicHack/master
Update to 0.17.12
2019-03-15 07:33:29 -07:00
e6290605c7 Update to 0.17.12 2019-03-14 16:45:22 -04:00
662372a1ba Update to 0.17.11 2019-03-11 23:24:16 +01:00
82f6bdf865 Merge pull request #212 from psykzz/patch-3
Update to 0.17.11
2019-03-11 23:23:44 +01:00
c9f4510195 Update to 0.17.11 2019-03-11 22:04:24 +00:00
6602c7cf7f Merge pull request #210 from notgne2/patch-1
Bump the Factorio version number in Dockerfile
2019-03-11 20:18:01 +01:00
8be7b47c07 Bump the Factorio version number in Dockerfile 2019-03-11 18:55:35 +00:00
717275198e Merge pull request #209 from pascaldulieu/master
0.17.10
2019-03-11 19:20:26 +01:00
d68ec4fdd4 Update README.md 2019-03-11 17:39:19 +00:00
47464e0b9b Update Dockerfile 2019-03-11 17:39:07 +00:00
23fdd4ed09 Update Dockerfile 2019-03-11 17:37:42 +00:00
e7a6bddc1f Merge pull request #207 from pascaldulieu/master
0.17.9
2019-03-08 11:49:10 -08:00
3d9e2999b6 Update README.md 2019-03-08 18:34:38 +00:00
7b33b9f6e8 Update Dockerfile 2019-03-08 18:33:28 +00:00
066c61fb85 Merge pull request #206 from pascaldulieu/master
0.17.8
2019-03-07 09:31:16 -08:00
303fbb5d97 Merge branch 'master' into master 2019-03-07 09:30:50 -08:00
3f4fd9e348 0.17.7 2019-03-07 09:18:40 -08:00
504ebfde23 Update README.md 2019-03-07 17:03:36 +00:00
f982370229 Update Dockerfile 2019-03-07 17:02:52 +00:00
51d3845af7 Merge pull request #202 from DeliciousJaffa/master
0.17.6
2019-03-05 11:02:59 -08:00
889c10bd48 0.17.6 2019-03-05 18:07:20 +00:00
46f397a9bb Update dockerfile for 0.17.6 2019-03-05 18:06:18 +00:00
988aa08a73 Merge pull request #200 from DBendit/stop-deleting-mapgen
Stop wiping out mapgen settings
2019-03-05 09:48:36 -08:00
ff6f4b6cd0 Merge pull request #201 from deveth0/master
#197: Enable envsubst
2019-03-05 09:48:06 -08:00
ea426ca0f4 Update README.md 2019-03-05 14:05:49 +01:00
4ecb1dcb6b Update README.md 2019-03-05 13:08:21 +01:00
3ef8c5309e #197: Enable envsubst - README 2019-03-05 13:05:27 +01:00
70c402b9dd #197: Enable envsubst 2019-03-05 12:47:23 +01:00
2b434ff08f Stop wiping out mapgen settings 2019-03-04 23:49:33 -06:00
49c5dff898 Merge pull request #199 from DBendit/fix-duplicate-banlist
Removing duplicate banlist line
2019-03-04 13:18:56 -08:00
35d22efc67 Removing duplicate banlist line 2019-03-04 15:14:59 -06:00
f1b75ac034 added contributor 2019-03-04 11:00:12 -08:00
fbb550916c Merge pull request #198 from DBendit/0.17.5
0.17.5
2019-03-04 10:53:26 -08:00
1d8be250e9 0.17.5 2019-03-04 12:47:39 -06:00
d90f45bd41 Merge pull request #195 from DBendit/0.17.4
0.17.4
2019-03-01 11:41:12 -08:00
2b201fea5b 0.17.4 2019-03-01 13:06:08 -06:00
b0a64e5939 minor text changes 2019-03-01 08:43:50 -08:00
ef24dad0bf Merge pull request #194 from DBendit/readme
Reorganizing volume listing to include map-settings and proper ordering
2019-02-28 14:01:13 -08:00
69a52f2c19 Reorganizing volume listing to include map-settings and proper ordering 2019-02-28 13:45:51 -06:00
902ad53bd3 Merge pull request #193 from DBendit/0.17.3
0.17.3
2019-02-28 11:36:06 -08:00
bd2af80a52 0.17.3 2019-02-28 13:26:18 -06:00
de9fb52d48 minor text changes 2019-02-28 09:35:29 -08:00
c0157e19ee added binutils 2019-02-28 17:33:30 +00:00
8e7bca222a generate map as factorio user 2019-02-27 19:45:13 +00:00
3e7c79ab74 update readme 2019-02-27 11:11:36 -08:00
979326ebf6 Merge pull request #189 from DBendit/fix-mapgen
Mapgen example fixed in 0.17.2
2019-02-27 11:10:11 -08:00
d5ac333364 make sure /opt/factorio/temp exists 2019-02-27 19:09:35 +00:00
e941e9a2c8 Mapgen example fixed in 0.17.2 2019-02-27 13:06:47 -06:00
6fece0c9e3 Merge pull request #188 from DBendit/0.17.2
0.17.2
2019-02-27 10:27:22 -08:00
10d000408c take ownership of /opt/factorio/temp 2019-02-27 18:25:54 +00:00
d59fd0844a 0.17.2 2019-02-27 12:23:11 -06:00
324920cdf8 don't run su-exec if container starts as non-root 2019-02-27 16:30:46 +00:00
2c88f5e982 Merge pull request #185 from DBendit/master
Adding support for 0.17's new banlist and adminlist options
2019-02-26 20:02:24 -08:00
26cec3ae93 Adding banlist support 2019-02-26 19:30:47 -06:00
7897de5080 Adding support for adminlist 2019-02-26 19:26:59 -06:00
b474afc1b7 tag description update 2019-02-26 14:51:16 -08:00
795ec7dc55 0.17.1 2019-02-26 14:34:54 -08:00
03f171e34c updated tag descriptions 2019-02-26 14:32:32 -08:00
313faf6fa5 0.17 tags 2019-02-26 14:19:35 -08:00
17109c97c1 removed unused USER directive 2019-02-26 14:18:43 -08:00
e62f5e799a updated docker tag for 0.17 2019-02-26 14:08:37 -08:00
47a7b8312f Merge pull request #183 from notgne2/master
workaround 0.17 issues (fix #181 and #182)
2019-02-26 13:26:44 -08:00
3cdf39d04b Merge branch '0.17-debug' into master 2019-02-26 21:19:14 +00:00
b840e86d21 use su-exec instead of gosu; don't use example map settings 2019-02-26 21:13:05 +00:00
a9047cae58 workaround 0.17 issues 2019-02-26 14:12:51 -07:00
bf128afdb4 debugging branch 2019-02-26 19:55:45 +00:00
f5ffae1cb4 make scripts executable 2019-02-26 19:44:26 +00:00
31b6768882 updated sha1 for 0.17.0 2019-02-26 19:24:59 +00:00
41eca9edf6 correct case on Dockerfile 2019-02-26 19:22:53 +00:00
86169c9dad add files to 0.17 2019-02-26 11:11:21 -08:00
f36e58058b update sha1 for 0.17.0 2019-02-26 11:09:08 -08:00
1a12761739 Merge pull request #178 from nexusmaniac/patch-1
Create 0.17 dockerfile
2019-02-26 11:03:14 -08:00
7f43739481 Create 0.17 dockerfile
Updated to Alpine 3.9 & added preliminary support for the 0.17 headless binary (once released) 💥
2019-02-26 17:31:14 +00:00
33e33a4db7 update to 0.16.51 2018-06-15 12:42:59 +00:00
2d54d50951 update to 0.16.50 2018-06-11 15:32:59 +00:00
86c8270d99 update to 0.16.49 2018-06-08 11:52:59 +00:00
5109bc1b40 update to 0.16.48 2018-06-07 17:33:00 +00:00
5e36f8bad8 update to 0.16.47 2018-05-31 07:47:59 +00:00
d1258008c1 Added catch all to allow custom options for factorio (#169) 2018-05-30 20:37:46 +02:00
275faa1fcc update to 0.16.46 2018-05-29 14:03:01 +00:00
87cf6c051a Fixed wrong checksum 2018-05-23 09:41:09 +02:00
3d8cdfcc1d update to 0.16.45 2018-05-22 20:07:47 +00:00
d3ef74b10d update to 0.16.43 (#162) 2018-05-16 18:03:52 +02:00
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
e53c2adc54 Fix adduser 2018-02-03 21:15:07 +00: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
28 changed files with 607 additions and 284 deletions

14
.hadolint.yaml Normal file
View File

@ -0,0 +1,14 @@
ignored:
# ignore apt version pinning
- DL3008
# ignore pip version pinning
- DL3013
# ignore apk version pinning
- DL3018
# ignore pipefail cause Balena/resin.io images do not work with it
- DL4006
# ignore false positive regex
- SC1083
- SC2086
# ignore as need for debug
- SC2005

27
.travis.yml Normal file
View File

@ -0,0 +1,27 @@
dist: xenial
sudo: required
language: bash
services:
- docker
addons:
apt:
packages:
- jq
jobs:
include:
- stage: test
script:
- git ls-files --exclude='*Dockerfile' --ignored | xargs --max-lines=1 -I{} sh -c 'docker run --rm -i -v ${PWD}/.hadolint.yaml:/.hadolint.yaml hadolint/hadolint < "$1"' -- {}
- bash -c 'shopt -s globstar; shellcheck **/*.sh'
- &build
stage: build
env: VERSION_SHORT=0.17 EXTRA_TAG=latest
script:
- ./build.sh $VERSION_SHORT
- <<: *build
env: VERSION_SHORT=0.16 EXTRA_TAG=stable
- <<: *build
env: VERSION_SHORT=0.15
- <<: *build
env: VERSION_SHORT=0.14

View File

@ -1,28 +0,0 @@
FROM frolvlad/alpine-glibc:alpine-3.4
MAINTAINER https://github.com/dtandersen/docker_factorio_server
COPY ./factorio.crt /opt/factorio.crt
ENV VERSION=0.13.20 \
SHA1=59ed0edb3f62f0f41a01fc291959b0a8b44cf631
RUN apk --no-cache add curl tini pwgen && \
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 && \
apk del curl && \
ln -s /factorio/saves /opt/factorio/saves && \
ln -s /factorio/mods /opt/factorio/mods
VOLUME /factorio
EXPOSE 34197/udp 27015/tcp
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/docker-entrypoint.sh"]

View File

@ -1 +0,0 @@
sudo docker build -t dtandersen/factorio:0.13-dev .

View File

@ -1 +0,0 @@
sudo rm -rf /tmp/factorio

View File

@ -1,35 +0,0 @@
#!/bin/sh -x
set -e
SAVES=/factorio/saves
CONFIG=/factorio/config
mkdir -p $SAVES
mkdir -p /factorio/mods
mkdir -p $CONFIG
if [ ! -f $CONFIG/rconpw ]; then
echo $(pwgen 15 1) > $CONFIG/rconpw
fi
if [ ! -f $CONFIG/server-settings.json ]; then
cp /opt/factorio/data/server-settings.example.json $CONFIG/server-settings.json
fi
if [ ! -f $CONFIG/map-gen-settings.json ]; then
cp /opt/factorio/data/map-gen-settings.example.json $CONFIG/map-gen-settings.json
fi
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
/opt/factorio/bin/x64/factorio \
--create $SAVES/_autosave1.zip \
--map-gen-settings $CONFIG/map-gen-settings.json
fi
exec /opt/factorio/bin/x64/factorio \
--port 34197 \
--start-server-load-latest \
--server-settings $CONFIG/server-settings.json \
--rcon-port 27015 \
--rcon-password "$(cat $CONFIG/rconpw)"

View File

@ -1,92 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIGCDCCA/CgAwIBAgIQKy5u6tl1NmwUim7bo3yMBzANBgkqhkiG9w0BAQwFADCB
hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTQwMjEy
MDAwMDAwWhcNMjkwMjExMjM1OTU5WjCBkDELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
Q09NT0RPIENBIExpbWl0ZWQxNjA0BgNVBAMTLUNPTU9ETyBSU0EgRG9tYWluIFZh
bGlkYXRpb24gU2VjdXJlIFNlcnZlciBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP
ADCCAQoCggEBAI7CAhnhoFmk6zg1jSz9Ad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CitlttNCbxWyuHv77+ldU9U0
WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
-----END CERTIFICATE-----

View File

@ -1,5 +0,0 @@
sudo docker run --rm -it \
-v /tmp/factorio:/factorio \
--name factorio \
dtandersen/factorio:0.13-dev "$@"
find /tmp/factorio -type f

View File

@ -1,11 +1,11 @@
FROM frolvlad/alpine-glibc:alpine-3.4
FROM frolvlad/alpine-glibc:alpine-3.9
MAINTAINER https://github.com/dtandersen/docker_factorio_server
LABEL maintainer="https://github.com/factoriotools/factorio-docker"
ENV VERSION=0.14.23 \
SHA1=6ef84341c6fc1cf45cfdd6acc8468aaa117b9e8a
RUN mkdir /opt && \
RUN mkdir -p /opt && \
apk --no-cache add curl tini pwgen && \
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \
-o /tmp/factorio_headless_x64_$VERSION.tar.gz && \

View File

@ -1 +1,2 @@
#!/bin/sh
sudo docker build --no-cache -t factorio .

View File

@ -1 +1,2 @@
#!/bin/sh
sudo rm -rf /tmp/factorio

View File

@ -1,35 +1,35 @@
#!/bin/sh -x
set -e
set -euo pipefail
SAVES=/factorio/saves
CONFIG=/factorio/config
mkdir -p $SAVES
mkdir -p "$SAVES"
mkdir -p /factorio/mods
mkdir -p $CONFIG
mkdir -p "$CONFIG"
if [ ! -f $CONFIG/rconpw ]; then
echo $(pwgen 15 1) > $CONFIG/rconpw
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
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
if [ ! -f "$CONFIG/map-gen-settings.json" ]; then
cp /opt/factorio/data/map-gen-settings.example.json "$CONFIG/map-gen-settings.json"
fi
if ! find -L $SAVES -iname \*.zip -mindepth 1 -print | grep -q .; then
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
--create "$SAVES/_autosave1.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json"
fi
exec /opt/factorio/bin/x64/factorio \
--port 34197 \
--start-server-load-latest \
--server-settings $CONFIG/server-settings.json \
--server-settings "$CONFIG/server-settings.json" \
--rcon-port 27015 \
--rcon-password "$(cat $CONFIG/rconpw)"
--rcon-password "$(cat "$CONFIG/rconpw")"

View File

@ -1,3 +1,4 @@
#!/bin/sh
sudo docker run --rm -it \
-v /tmp/factorio:/factorio \
--name factorio \

View File

@ -1,13 +1,13 @@
FROM frolvlad/alpine-glibc:alpine-3.6
FROM frolvlad/alpine-glibc:alpine-3.9
MAINTAINER https://github.com/dtandersen/docker_factorio_server
LABEL maintainer="https://github.com/factoriotools/factorio-docker"
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=0.15.40 \
SHA1=f79a975f6b8c0ee87e2fa60f7d1f7133f332c3ec
RUN mkdir /opt && \
RUN mkdir -p /opt && \
apk add --update --no-cache tini pwgen && \
apk add --update --no-cache --virtual .build-deps curl && \
curl -sSL https://www.factorio.com/get-download/$VERSION/headless/linux64 \

View File

@ -1,43 +1,43 @@
#!/bin/sh -x
set -e
set -euo pipefail
SAVES=/factorio/saves
CONFIG=/factorio/config
mkdir -p $SAVES
mkdir -p "$SAVES"
mkdir -p /factorio/mods
mkdir -p $CONFIG
mkdir -p "$CONFIG"
if [ ! -f $CONFIG/rconpw ]; then
echo $(pwgen 15 1) > $CONFIG/rconpw
if [ ! -f "$CONFIG/rconpw" ]; then
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
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
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
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 \
--create $SAVES/_autosave1.zip \
--map-gen-settings $CONFIG/map-gen-settings.json \
--map-settings $CONFIG/map-settings.json
--create "$SAVES/_autosave1.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
exec /opt/factorio/bin/x64/factorio \
--port $PORT \
--port "$PORT" \
--start-server-load-latest \
--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-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

View File

@ -1,6 +1,6 @@
FROM frolvlad/alpine-glibc:alpine-3.7
FROM frolvlad/alpine-glibc:alpine-3.9
MAINTAINER https://github.com/dtandersen/docker_factorio_server
LABEL maintainer="https://github.com/factoriotools/factorio-docker"
ARG USER=factorio
ARG GROUP=factorio
@ -9,11 +9,18 @@ ARG PGID=845
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=0.16.23 \
SHA1=edb8e75f606180ee1d829072af14a946cff26a4b
VERSION=0.16.51 \
SHA1=127e7ff484ab263b13615d6114013ce0a66ac929 \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
SCRIPTOUTPUT=/factorio/script-output \
PUID="$PUID" \
PGID="$PGID"
RUN mkdir -p /opt /factorio && \
apk add --update --no-cache pwgen && \
apk add --update --no-cache pwgen su-exec shadow && \
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 && \
@ -21,19 +28,19 @@ 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 /
USER $USER
COPY files/ /
ENTRYPOINT ["/docker-entrypoint.sh"]

View File

@ -1,47 +0,0 @@
#!/bin/sh -x
set -e
id
SAVES=/factorio/saves
CONFIG=/factorio/config
mkdir -p $SAVES
mkdir -p /factorio/mods
mkdir -p $CONFIG
#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
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
exec /opt/factorio/bin/x64/factorio \
--port $PORT \
--start-server-load-latest \
--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

62
0.16/files/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,62 @@
#!/bin/sh -x
set -euo pipefail
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
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
if find -L "$SAVES" -iname \*.tmp.zip -mindepth 1 -print | grep -q .; then
rm -f "$SAVES"/*.tmp.zip
fi
if [ "$(id -u)" = '0' ]; then
# Update the User and Group ID based on the PUID/PGID variables
usermod -o -u "$PUID" factorio
groupmod -o -g "$PGID" factorio
# Take ownership of factorio data if running as root
chown -R factorio:factorio "$FACTORIO_VOL"
# Drop to the factorio user
SU_EXEC="su-exec factorio"
else
SU_EXEC=""
fi
if ! find -L "$SAVES" -iname \*.zip -mindepth 1 -print | grep -q .; then
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/_autosave1.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
$SU_EXEC /opt/factorio/bin/x64/factorio \
--port "$PORT" \
--start-server-load-latest \
--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 \
"$@"

42
0.16/files/scenario.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh -x
if [ -z "$1" ]; then
echo "No argument supplied"
fi
SERVER_SCENARIO=$1
set -euo pipefail
id
mkdir -p "$SAVES"
mkdir -p "$CONFIG"
mkdir -p "$MODS"
mkdir -p "$SCENARIOS"
#chown -R factorio /factorio
if [ ! -f "$CONFIG/rconpw" ]; then
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 "$SERVER_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

29
0.16/files/scenario2map.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh -x
if [ -z "$1" ]; then
echo "No argument supplied"
fi
SERVER_SCENARIO=$1
set -euo pipefail
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 "$SERVER_SCENARIO"

46
0.17/Dockerfile Normal file
View File

@ -0,0 +1,46 @@
FROM frolvlad/alpine-glibc:alpine-3.9
LABEL maintainer="https://github.com/factoriotools/factorio-docker"
ARG USER=factorio
ARG GROUP=factorio
ARG PUID=845
ARG PGID=845
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=0.17.48 \
SHA1=db52809ddb5b9faccb7b397269586e932061f12c \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
SCRIPTOUTPUT=/factorio/script-output \
PUID="$PUID" \
PGID="$PGID"
RUN mkdir -p /opt /factorio && \
apk add --update --no-cache pwgen su-exec binutils gettext libintl shadow && \
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"]

12
0.17/docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: '2'
services:
factorio:
build: .
ports:
- "34197:34197/udp"
- "27015:27015/tcp"
volumes:
- /opt/factorio:/factorio
# environment:
# - PUID=1000
# - PGID=1000

71
0.17/files/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,71 @@
#!/bin/sh -x
set -euo pipefail
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
# Generate a new RCON password if none exists
pwgen 15 1 >"$CONFIG/rconpw"
fi
if [ ! -f "$CONFIG/server-settings.json" ]; then
# Copy default settings if server-settings.json doesn't exist
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
NRTMPSAVES=$( find -L "$SAVES" -iname \*.tmp.zip -mindepth 1 | wc -l )
if [ "$NRTMPSAVES" -gt 0 ]; then
# Delete incomplete saves (such as after a forced exit)
rm -f "$SAVES"/*.tmp.zip
fi
if [ "$(id -u)" = '0' ]; then
# Update the User and Group ID based on the PUID/PGID variables
usermod -o -u "$PUID" factorio
groupmod -o -g "$PGID" factorio
# Take ownership of factorio data if running as root
chown -R factorio:factorio "$FACTORIO_VOL"
# Drop to the factorio user
SU_EXEC="su-exec factorio"
else
SU_EXEC=""
fi
NRSAVES=$( find -L "$SAVES" -iname \*.zip -mindepth 1 | wc -l )
if [ "$NRSAVES" -eq 0 ]; then
# Generate a new map if no save ZIPs exist
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/_autosave1.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
# shellcheck disable=SC2086
exec $SU_EXEC /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" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json \
"$@"

42
0.17/files/scenario.sh Executable file
View File

@ -0,0 +1,42 @@
#!/bin/sh -x
if [ -z "$1" ]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
set -euo pipefail
id
mkdir -p "$SAVES"
mkdir -p "$CONFIG"
mkdir -p "$MODS"
mkdir -p "$SCENARIOS"
#chown -R factorio /factorio
if [ ! -f "$CONFIG/rconpw" ]; then
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 "$SERVER_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

29
0.17/files/scenario2map.sh Executable file
View File

@ -0,0 +1,29 @@
#!/bin/sh -x
if [ -z "$1" ]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
set -euo pipefail
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 "$SERVER_SCENARIO"

133
README.md
View File

@ -1,15 +1,15 @@
# 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/)
# Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) [![](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio) [![](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Stars](https://img.shields.io/docker/stars/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/)
* `0.16.23`, `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.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.17.48`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile)
* `0.16.51`, `0.16`, `stable` [(0.16/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.16/Dockerfile)
* `0.15.40`, `0.15` [(0.15/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.15/Dockerfile)
* `0.14.23`, `0.14` [(0.14/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.14/Dockerfile)
*Tag descriptions*
* `latest` - highest version: may be experimental.
* `stable` - highest version declared stable.
* `0.x` - highest version in a branch: may be experimental.
* `latest` - most up-to-date version (may be experimental).
* `stable` - version declared stable on [factorio.com](https://www.factorio.com).
* `0.x` - latest version in a branch.
* `0.x.y` - a specific version.
* `0.x-dev` - whatever is in master for that version.
@ -40,7 +40,7 @@ sudo docker run -d \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
dtandersen/factorio
factoriotools/factorio
```
For those new to Docker, here is an explanation of the options:
@ -80,7 +80,7 @@ To issue console commands to the server, start the server in interactive mode wi
docker run -d -it \
--name factorio \
dtandersen/factorio
factoriotools/factorio
docker attach factorio
@ -94,7 +94,7 @@ Delete the container and refresh the image:
docker stop factorio
docker rm factorio
docker pull dtandersen/factorio
docker pull factoriotools/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!
@ -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" \
factoriotools/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 usage 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" \
factoriotools/factorio
MyScenarioName
```
## RCON
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
@ -131,6 +163,49 @@ Create file `config/server-whitelist.json` and add the whitelisted users.
"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"
]
## Customize configuration files (0.17.x+)
Out-of-the box, factorio does not support environment variables inside the configuration files. A workaround is the usage of `envsubst` which generates the configuration files dynamically during startup from environment variables set in docker-compose:
Example which replaces the server-settings.json:
factorio_1:
image: factoriotools/factorio
ports:
- "34197:34197/udp"
volumes:
- /opt/factorio:/factorio
- ./server-settings.json:/server-settings.json
environment:
- INSTANCE_NAME=Your Instance's Name
- INSTANCE_DESC=Your Instance's Description
entrypoint: /bin/sh -c "mkdir -p /factorio/config && envsubst < /server-settings.json > /factorio/config/server-settings.json && exec /docker-entrypoint.sh"
The `server-settings.json` file may then contain the variable references like this:
"name": "${INSTANCE_NAME}",
"description": "${INSTANCE_DESC}",
# Container Details
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
@ -144,10 +219,15 @@ The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
To keep things simple, the container uses a single volume mounted at `/factorio`. This volume stores configuration, mods, and saves.
The files in this volume should be owned by the factorio user, uid 845.
factorio
|-- config
| |-- map-gen-settings.json
| |-- map-settings.json
| |-- rconpw
| |-- server-adminlist.json
| |-- server-banlist.json
| |-- server-settings.json
| `-- server-whitelist.json
|-- mods
@ -155,16 +235,15 @@ To keep things simple, the container uses a single volume mounted at `/factorio`
`-- saves
`-- _autosave1.zip
## Docker Compose
[Docker Compose](https://docs.docker.com/compose/install/) is an easy way to run Docker containers.
First get a [docker-compose.yml](https://github.com/dtandersen/docker_factorio_server/blob/master/0.16/docker-compose.yml) file. To get it from this repository:
First get a [docker-compose.yml](https://github.com/factoriotools/factorio-docker/blob/master/0.17/docker-compose.yml) file. To get it from this repository:
```
git clone https://github.com/dtandersen/docker_factorio_server.git
cd docker_factorio_server/0.16
git clone https://github.com/factoriotools/factorio-docker.git
cd docker_factorio_server/0.17
```
Or make your own:
@ -173,7 +252,7 @@ Or make your own:
version: '2'
services:
factorio:
image: dtandersen/factorio
image: factoriotools/factorio
ports:
- "34197:34197/udp"
- "27015:27015/tcp"
@ -198,8 +277,8 @@ sudo docker-compose up -d
## Environment Variables
* `PORT` (0.15+) - Start the server on an alterate port, .e.g. `docker run -e "PORT=34198"`.
* `RCON_PORT` (0.16+) - Start the RCON on an alterate port, .e.g. `docker run -e "RCON_PORT=34198"`.
* `PORT` (0.15+) - Start the server on an alternate port, .e.g. `docker run -e "PORT=34198"`.
* `RCON_PORT` (0.16+) - Start the RCON on an alternate port, .e.g. `docker run -e "RCON_PORT=34198"`.
## LAN Games
@ -224,19 +303,23 @@ sudo docker run -d \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
dtandersen/factorio
factoriotools/factorio
```
VirtualBox users must enable Bridged networking in order for the host to be assigned an internal network IP. Enable Bridged networking in Vagrant with:
## Vagrant
[Vagrant](https://www.vagrantup.com/) is a easy way to setup a virtual machine (VM) to run Docker. The [Factorio Vagrant box repository](https://github.com/dtandersen/factorio-lan-vagrant) contains a sample Vagrantfile.
For LAN games the VM needs an internal IP in order for clients to connect. One way to do this is with a public network. The VM uses DHCP to acquire an IP address. The VM must also forward port 34197.
```
config.vm.network "public_network"
config.vm.network "forwarded_port", guest: 34197, host: 34197
```
## Vagrant
## Amazon Web Services (AWS) Deployment
Vagrant is a good way for those without a Linux machine to try Docker. Check out the [Factorio Vagrant Box](https://github.com/dtandersen/factorio-lan-vagrant).
If you're looking for a simple way to deploy this to the Amazon Web Services Cloud, check out the [Factorio Server Deployment (CloudFormation) repository](https://github.com/m-chandler/factorio-spot-pricing). This repository contains a CloudFormation template that will get you up and running in AWS in a matter of minutes. Optionally it uses Spot Pricing so the server is very cheap, and you can easily turn it off when not in use.
## Troubleshooting
@ -255,8 +338,12 @@ Use the `PORT` environment variable to start the server on the a different port,
# Contributors
* [dtandersen](https://github.com/dtandersen/docker_factorio_server) - Maintainer
* [dtandersen](https://github.com/dtandersen) - Maintainer
* [Fank](https://github.com/Fankserver/docker-factorio-watchdog) - Keeper of the Factorio watchdog that keeps the version up-to-date.
* [SuperSandro2000](https://github.com/supersandro2000) - CI Guy
* [DBendit](https://github.com/DBendit/docker_factorio_server) - Admin list, ban list, version updates
* [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

59
build.sh Executable file
View File

@ -0,0 +1,59 @@
#!/bin/bash
set -eox pipefail
if [ -z "$1" ] && [ -n "$CI" ]; then
echo "Usage: ./build.sh \$VERSION_SHORT"
exit 1
elif [ "$CI" == "true" ]; then
VERSION_SHORT="$1"
else
VERSION_SHORT=$(find . -maxdepth 1 -type d | sort | tail -1 | grep -o "[0-9].[0-9]*")
EXTRA_TAG=latest
fi
cd "$VERSION_SHORT" || exit
VERSION=$(grep -oP '[0-9]+\.[0-9]+\.[0-9]+' Dockerfile | head -1)
DOCKER_REPO=factoriotools/factorio
if [ "$TRAVIS_PULL_REQUEST" == "true" ]; then
TAGS="$DOCKER_REPO:$TRAVIS_PULL_REQUEST_SLUG"
else
if [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "$VERSION" ]; then
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
elif [ -n "$TRAVIS_BRANCH" ]; then
TAGS="$DOCKER_REPO:$TRAVIS_BRANCH"
elif [ "$CI" == "" ]; then
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
fi
if [ -n "$EXTRA_TAG" ]; then
TAGS="$TAGS -t $DOCKER_REPO:$EXTRA_TAG"
fi
fi
# shellcheck disable=SC2086
docker build . -t $TAGS
docker images
if [[ "$(dirname "$(git diff --name-only HEAD^)")" =~ $VERSION_SHORT ]] && [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ] ||
[ "$TRAVIS_BRANCH" == "$VERSION" ] && [ "$TRAVIS_PULL_REQUEST_BRANCH" == "" ] ||
[ "$CI" == "" ]; then
if [ "$CI" == "true" ]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
if [ -n "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "$VERSION" ] && [ "$TRAVIS_BRANCH" != "master" ]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
fi
if [ -n "$TRAVIS_TAG" ] || [ "$CI" == "" ]; then
docker push "$DOCKER_REPO:$VERSION"
docker push "$DOCKER_REPO:$VERSION_SHORT"
fi
if [ -n "$EXTRA_TAG" ]; then
docker push "$DOCKER_REPO:$EXTRA_TAG"
fi
curl -X POST https://hooks.microbadger.com/images/factoriotools/factorio/TmmKGNp8jKcFqZvcJhTCIAJVluw=
fi

2
lint.sh Executable file
View File

@ -0,0 +1,2 @@
#!/bin/bash
git ls-files --exclude='*Dockerfile' --ignored | xargs --max-lines=1 ./hadolint