Compare commits

...

292 Commits

Author SHA1 Message Date
cea55cda67 Update Dockerfile to support Factorio 1.1.36 (#398)
Resolve #397 by adding Factorio 1.1.36 support

Co-authored-by: jpsenior <jp.senior@gmail.com>
2021-07-13 21:50:47 +02:00
b0ad3fa036 Update to Factorio 0.18.47 2021-06-23 15:02:49 +00:00
1a6e902c6b Update to Factorio 0.18.47 2021-06-21 15:23:33 +00:00
dadf88d5e3 Update to Factorio 0.18.47 2021-06-21 05:12:29 +00:00
b065ecb257 Update to Factorio 0.18.47 2021-06-20 18:59:25 +00:00
f0b1ff342f Update to Factorio 0.18.47 2021-06-20 13:19:09 +00:00
9a563a35b8 Update to Factorio 0.18.47 2021-06-20 08:54:29 +00:00
75543ebbe6 Update to Factorio 0.18.47 2021-06-20 02:20:10 +00:00
d17a6e648e Update to Factorio 0.18.47 2021-06-19 09:44:12 +00:00
b96fb634b1 Update to Factorio 0.18.47 2021-06-18 03:24:45 +00:00
9248c57549 Update to Factorio 0.18.47 2021-06-17 11:48:40 +00:00
8641b6d34b Update to Factorio 0.18.47 2021-06-17 11:24:07 +00:00
aefd5339c6 Update to Factorio 1.1.35 2021-06-16 16:27:58 +00:00
504aa3a05a Update to Factorio 0.18.47 2021-06-16 10:58:07 +00:00
ccc7f5624a Update to Factorio 0.18.47 2021-06-16 10:55:45 +00:00
0336fbe3cf Update to Factorio 0.18.47 2021-06-16 10:33:27 +00:00
452aab7ffb Update to Factorio 0.18.47 2021-06-16 10:08:06 +00:00
a953759b96 Update to Factorio 0.18.47 2021-06-16 10:06:42 +00:00
f61abdc8b5 Update to Factorio 0.18.47 2021-06-16 09:44:42 +00:00
bb4d2d0154 Update to Factorio 0.18.47 2021-06-16 09:41:34 +00:00
f44f690b6a Update to Factorio 0.18.47 2021-06-16 01:12:34 +00:00
eadada76b9 Update to Factorio 0.18.47 2021-06-15 18:25:45 +00:00
45eb323d17 Update to Factorio 0.18.47 2021-06-15 16:45:41 +00:00
cad67f5d0b Update to Factorio 0.18.47 2021-06-15 15:45:43 +00:00
18fe336fb8 Update to Factorio 0.18.47 2021-06-15 15:30:50 +00:00
a7c9b3e1c8 Update to Factorio 0.18.47 2021-06-15 10:55:53 +00:00
2026cce01a Update to Factorio 0.18.47 2021-06-14 12:36:38 +00:00
7b7f47f464 Update to Factorio 0.18.47 2021-06-14 05:24:13 +00:00
1f83234834 Update to Factorio 0.18.47 2021-06-13 20:46:18 +00:00
bc06b94f38 Update to Factorio 0.18.47 2021-06-12 12:11:20 +00:00
3abd2d69fc Update to Factorio 0.18.47 2021-06-12 08:31:41 +00:00
63fc1066dc Update to Factorio 0.18.47 2021-06-12 03:56:47 +00:00
7f4e005b1a Update to Factorio 0.18.47 2021-06-10 21:29:54 +00:00
5222d392b1 Update to Factorio 0.18.47 2021-06-10 12:21:32 +00:00
be8c1b28a3 Update to Factorio 0.18.47 2021-06-08 16:45:37 +00:00
e5a70d4ada Update to Factorio 0.18.47 2021-06-06 21:30:20 +00:00
31448a0c06 Update to Factorio 0.18.47 2021-06-06 17:37:22 +00:00
6d2fcd5696 Update to Factorio 0.18.47 2021-06-06 16:22:33 +00:00
65b909310c Update to Factorio 0.18.47 2021-06-06 13:05:51 +00:00
e8fca26f7a Update to Factorio 0.18.47 2021-06-06 11:55:03 +00:00
6ce248eacb Update to Factorio 0.18.47 2021-06-05 14:06:06 +00:00
a683f67f86 Update to Factorio 0.18.47 2021-06-05 10:06:28 +00:00
b253a086cc Update to Factorio 0.18.47 2021-06-04 10:35:23 +00:00
36ecbb3de8 Update to Factorio 0.18.47 2021-06-01 05:54:15 +00:00
3bd6929ee7 Update to Factorio 0.18.47 2021-05-31 05:28:27 +00:00
cb4f36fc91 Update to Factorio 0.18.47 2021-05-27 07:11:10 +00:00
06433d2ba1 Update to Factorio 0.18.47 2021-05-26 15:15:43 +00:00
31a0c78ba6 Update to Factorio 0.18.47 2021-05-26 13:08:55 +00:00
29f5222c35 Update to Factorio 0.18.47 2021-05-25 17:24:50 +00:00
13ebf33867 Update to Factorio 0.18.47 2021-05-24 13:21:35 +00:00
3947458623 Update to Factorio 1.1.34 2021-05-24 11:46:29 +00:00
cb6eb6e519 Update to Factorio 0.18.47 2021-05-24 06:38:10 +00:00
9896b03e0a Update to Factorio 0.18.47 2021-05-23 21:50:10 +00:00
5176be56db Update to Factorio 0.18.47 2021-05-23 21:19:31 +00:00
72fdb9fc42 Update to Factorio 0.18.47 2021-05-23 07:17:00 +00:00
b0b62d5ba7 Update to Factorio 0.18.47 2021-05-20 22:11:42 +00:00
4f73862221 Update to Factorio 0.18.47 2021-05-19 17:37:45 +00:00
5b83699e5c Update to Factorio 0.18.47 2021-05-15 10:46:54 +00:00
511520c459 Update to Factorio 0.18.47 2021-05-15 07:23:50 +00:00
99db93d6f8 Update to Factorio 0.18.47 2021-05-14 22:43:13 +00:00
24825309c3 Update to Factorio 0.18.47 2021-05-14 22:18:14 +00:00
db25aab203 Update to Factorio 0.18.47 2021-05-14 22:08:13 +00:00
d10ec1e309 Update to Factorio 0.18.47 2021-05-13 23:04:53 +00:00
14851be061 Update to Factorio 0.18.47 2021-05-13 22:53:34 +00:00
1212e00fa3 Update to Factorio 0.18.47 2021-05-11 12:31:29 +00:00
c537410871 Update to Factorio 0.18.47 2021-05-11 01:01:33 +00:00
068b96ae2b Update to Factorio 0.18.47 2021-05-06 07:08:36 +00:00
9c3ec3c817 Update to Factorio 0.18.47 2021-05-04 13:36:13 +00:00
229f3d7fda Update to Factorio 0.18.47 2021-05-04 10:42:44 +00:00
248dab3db1 Update to Factorio 0.18.47 2021-05-04 10:22:59 +00:00
c25e2c8a1d Disable 0.18 because it got yanked from the download servers 2021-05-03 19:04:50 +02:00
4a84743920 Update to Factorio 1.1.33 2021-05-03 16:53:19 +00:00
cc4f8b192d Upgrade to GitHub-native Dependabot (#389)
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-30 01:49:38 +02:00
acd9c559fb Update to Factorio 0.18.47 2021-04-28 14:29:19 +00:00
ff7074822b Update to Factorio 0.18.47 2021-04-26 02:21:25 +00:00
99100f8495 Update to Factorio 0.18.47 2021-04-23 15:33:06 +00:00
939827eb81 Update to Factorio 0.18.47 2021-04-20 21:31:10 +00:00
7c1406b38c Update to Factorio 0.18.47 2021-04-20 19:31:09 +00:00
5f7a32e492 Update to Factorio 0.18.47 2021-04-20 14:07:30 +00:00
a11cbbbf41 Update to Factorio 0.18.47 2021-04-20 11:37:28 +00:00
dac8e07016 Update to Factorio 0.18.47 2021-04-20 11:07:37 +00:00
63fcb292a8 Update to Factorio 0.18.47 2021-04-20 06:47:30 +00:00
2a313aa6d6 Update to Factorio 0.18.47 2021-04-19 13:17:29 +00:00
b5a6059386 Update to Factorio 0.18.47 2021-04-19 11:22:26 +00:00
5904849dbc Update to Factorio 0.18.47 2021-04-19 04:57:43 +00:00
1987d7b43a Update to Factorio 0.18.47 2021-04-18 19:02:18 +00:00
54b1a97074 Bump frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13 in /0.18 (#358)
Bumps frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-16 11:21:19 +02:00
ec1aef13d6 Bump frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13 in /0.15 (#359)
Bumps frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-16 11:21:13 +02:00
bc9ec68e87 Bump frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13 in /0.16 (#362)
Bumps frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-16 11:21:07 +02:00
51762ba589 Bump frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13 in /0.14 (#361)
Bumps frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-16 11:21:02 +02:00
dffc09f0ff Bump frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13 in /0.17 (#360)
Bumps frolvlad/alpine-glibc from alpine-3.12 to alpine-3.13.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-04-16 11:20:56 +02:00
cc7f772024 Update to Factorio 1.1.32 2021-04-14 08:51:20 +00:00
cef0016bf4 Update to Factorio 1.1.31 2021-04-13 07:38:54 +00:00
5b5a658116 Update to Factorio 1.1.30 2021-04-11 04:16:23 +00:00
3e3dfb7c05 Update to Factorio 1.1.30 2021-04-10 09:46:19 +00:00
e150272201 Update to Factorio 1.1.30 2021-04-06 07:52:03 +00:00
228cc517e0 Update to Factorio 1.1.30 2021-04-05 17:02:02 +00:00
850bb9aef0 Update to Factorio 1.1.30 2021-03-24 20:39:58 +00:00
caafc2cbef Update to Factorio 1.1.29 2021-03-24 18:05:14 +00:00
3f3fa0a008 Update to Factorio 1.1.28 2021-03-24 13:29:58 +00:00
af51b87df7 Update to Factorio 1.1.27 2021-03-19 03:31:22 +00:00
78b45f2cca Update to Factorio 1.1.27 2021-03-18 13:43:16 +00:00
257229118f Update to Factorio 1.1.27 2021-03-11 10:33:57 +00:00
6aadd6053a Merge pull request #376 from Thrimbda/doc/zh_CN-translation 2021-03-11 01:19:03 +01:00
db54b89dae Update to Factorio 1.1.26 2021-03-03 23:43:04 +00:00
64cad3e345 replace specific version info with a link to original ones 2021-03-04 00:39:29 +08:00
c88e79fd5b doc: finish translation 2021-03-04 00:39:29 +08:00
d0610c47d6 doc: add simplified Chinese translation. 2021-03-04 00:38:50 +08:00
851507c3ef Update to Factorio 1.1.26 2021-03-01 13:27:33 +00:00
3e5afe32ab Merge pull request #377 from jmriddell/patch-1
Fix small typo on README.md
2021-02-19 10:42:15 +01:00
2359a1c5d8 Fix small typo 2021-02-18 23:16:08 -03:00
d99ef45240 Update to Factorio 1.1.25 2021-02-17 17:47:25 +00:00
2b26cd1b69 Update to Factorio 1.1.24 2021-02-16 15:53:19 +00:00
7dddaf62bd Update to Factorio 1.1.24 2021-02-16 10:17:23 +00:00
3f034d0754 Update to Factorio 1.1.23 2021-02-16 08:38:07 +00:00
7720e32081 Update to Factorio 1.1.23 2021-02-16 07:17:24 +00:00
65049c8120 Update to Factorio 1.1.22 2021-02-15 21:27:28 +00:00
c94ab998b4 Update to Factorio 1.1.21 2021-02-12 23:33:03 +00:00
6e4ec92a95 Update to Factorio 1.1.21 2021-02-11 09:30:47 +00:00
7dcac4cdd7 Update to Factorio 1.1.21 2021-02-10 05:27:46 +00:00
cc70895c33 Update to Factorio 1.1.21 2021-02-06 21:14:54 +00:00
89b54579e0 Update to Factorio 1.1.21 2021-02-06 18:01:57 +00:00
c1e1a1c4ca Fix CI for PRs 2021-02-05 22:55:04 +01:00
429c88f290 Update to Factorio 1.1.21 2021-02-05 18:19:26 +00:00
074bf11633 Update to Factorio 1.1.20 2021-02-04 22:24:29 +00:00
5765088f7e Update to Factorio 1.1.19 2021-02-04 17:55:42 +00:00
316f790530 Update to Factorio 1.1.19 2021-02-04 08:41:53 +00:00
c91852a196 Update to Factorio 1.1.19 2021-02-04 06:45:27 +00:00
9ba7c5c8d6 Update to Factorio 1.1.19 2021-02-03 11:14:38 +00:00
f2a4223c7b Update to Factorio 1.1.19 2021-02-03 05:51:48 +00:00
2a5e5b48ef Update to Factorio 1.1.19 2021-02-02 19:13:10 +00:00
57e979bca1 Update to Factorio 1.1.19 2021-02-02 02:00:33 +00:00
88ca3293a6 Push base version on incremental tags 2021-01-28 00:19:59 +01:00
018269377a Remove ref/tags from version 2021-01-28 00:12:38 +01:00
846e102ac8 Fix version short for stable 2021-01-27 23:51:45 +01:00
4551f6ee03 Fix tag pushes 2021-01-27 23:49:40 +01:00
09db1e2141 Mark 1.1 as stable 2021-01-27 23:39:56 +01:00
cb9a9812bd Fix image in docker description update 2021-01-27 11:24:26 +01:00
d03e4063e7 Quote version numbers 2021-01-26 20:00:56 +01:00
21c5c85ac3 Fix yaml 2021-01-26 19:59:58 +01:00
a10642d3eb Use secrets properly 2021-01-26 19:57:15 +01:00
2856c1cf76 Update docker hub description update 2021-01-26 19:51:32 +01:00
3e736968d1 Converto to GitHub actions (#364) 2021-01-26 19:43:14 +01:00
ac6d647ddd Update to Factorio 1.1.19 2021-01-26 15:11:30 +00:00
02439750d1 Update to Factorio 1.1.18 2021-01-25 21:26:24 +00:00
3efae7b161 Update to Factorio 1.1.17 2021-01-25 18:26:24 +00:00
49a258c830 Update to Factorio 1.1.16 2021-01-25 10:11:39 +00:00
3ffa3610ef Update to Factorio 1.1.15 2021-01-24 17:31:24 +00:00
56984b2ef1 Update to Factorio 1.1.14 2021-01-23 09:11:24 +00:00
653c87a32e Update to Factorio 1.1.13 2021-01-22 12:31:24 +00:00
07bd20120c Update to Factorio 1.1.12 2021-01-16 11:01:09 +00:00
bd7347b42c ci: fix invalid yaml 2021-01-15 11:30:40 +01:00
cfbef2aedb ci: log into docker hub to pull the hadolint image 2021-01-15 11:21:25 +01:00
8436dfe8a0 Fix travis rate limiting
Should close #354
2021-01-15 10:39:24 +01:00
82892d8ad8 Update to Factorio 1.1.11 2021-01-14 17:31:28 +00:00
34132ddbd6 Update to Factorio 1.1.10 2021-01-14 14:31:29 +00:00
b52af78919 Update to Factorio 1.1.9 2021-01-14 09:56:29 +00:00
13964c7a50 Update to Factorio 1.1.8 2021-01-07 19:22:14 +00:00
e5e5dc27d2 Update to Factorio 1.1.7 2021-01-07 09:52:17 +00:00
8ad8f81eed Update to Factorio 1.1.6 2020-12-14 19:48:56 +00:00
b0e855bb8a Update to Factorio 1.1.5 2020-12-04 05:41:02 +00:00
31a60e976b Update to Factorio 1.1.4 2020-12-03 15:36:01 +00:00
c108d48f00 Update to Factorio 1.1.3 2020-11-30 17:50:45 +00:00
fa741f635f Update to Factorio 1.1.2 2020-11-28 12:15:35 +00:00
5258ed7843 Update to Factorio 1.1.1 2020-11-25 09:27:03 +00:00
d31d7f5ae6 Change stable to 1.0.0 2020-11-25 09:32:00 +01:00
0efbfb5c2d Updated readme 2020-11-24 09:25:46 +01:00
57f867aa80 Added travis 1.1 build 2020-11-24 09:24:53 +01:00
ded7d36fa8 Added 1.1.0 support (#348) 2020-11-24 09:20:42 +01:00
93822d930c Fix reading docker secrets token 2020-09-26 13:53:48 +02:00
5474bb842d Better document PORT env 2020-09-17 18:10:59 +02:00
ff432200f0 Added 1.0 for travis and marked it as latest & stable 2020-08-14 11:42:25 +02:00
310214eb46 Added 1.0 (#342) 2020-08-14 11:34:16 +02:00
bc3b08e470 Truly fix mod updates with spaces in names (#320) 2020-08-11 19:10:59 +02:00
1ef555ab24 Save op fix for scenario.sh and scenario2map.sh. (#340) 2020-08-11 18:54:25 +02:00
c8c6cb62ea Let scenario.sh script to use map-gen-settings.json/map-settings.json located in config directory. (#341) 2020-08-11 18:53:49 +02:00
ac21591ee9 Update to Factorio 0.18.47 2020-08-11 10:44:10 +00:00
bef01206d1 Update to Factorio 0.18.46 2020-08-10 20:09:09 +00:00
a7131499e4 Update to Factorio 0.18.45 2020-08-07 14:19:10 +00:00
2a2092755c Update to Factorio 0.18.44 2020-08-07 09:29:10 +00:00
7d50408b87 Update to Factorio 0.18.43 2020-08-06 16:29:10 +00:00
9a7174ddaf Update to Factorio 0.18.42 2020-08-03 17:34:20 +00:00
fffc38615f Update to Factorio 0.18.41 2020-08-03 05:39:09 +00:00
7b31cc044a Update to Factorio 0.18.40 2020-08-01 08:59:15 +00:00
0331df2774 Update to Factorio 0.18.39 2020-08-01 06:29:17 +00:00
1405a9be04 Update to Factorio 0.18.38 2020-07-30 06:54:11 +00:00
b630de0efa Update to Factorio 0.18.37 2020-07-29 15:24:10 +00:00
a2aec76419 Fix loading of scenarios (#336) 2020-07-29 14:20:02 +02:00
c112d3969f Update to Factorio 0.18.36 2020-07-15 22:42:15 +00:00
624c42a831 Update to Factorio 0.18.35 2020-07-06 12:58:00 +00:00
8c9adbbbc6 Update to Factorio 0.18.34 2020-06-26 11:07:58 +00:00
e057dd5b22 Update to Factorio 0.18.33 2020-06-24 12:26:22 +00:00
a5b2e042a9 Bump frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12 in /0.15 (#332)
Bumps frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-19 18:46:05 +02:00
9960cc856d Bump frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12 in /0.16 (#331)
Bumps frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-19 18:44:49 +02:00
1bb5f2610e Bump frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12 in /0.14 (#329)
Bumps frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-19 18:44:16 +02:00
8ee8fafe38 Bump frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12 in /0.17 (#330)
Bumps frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-19 18:42:15 +02:00
ab33e69fb1 Bump frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12 in /0.18 (#328)
Bumps frolvlad/alpine-glibc from alpine-3.11 to alpine-3.12.

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2020-06-19 18:41:15 +02:00
d14fb33575 Don't crash when building no tag 2020-06-19 18:39:59 +02:00
3f4e823fbc Update to Factorio 0.18.32 2020-06-16 09:31:20 +00:00
e439c21591 Update to Factorio 0.18.31 2020-06-10 11:04:03 +00:00
c7bb5393ad Update to Factorio 0.18.30 2020-06-03 13:59:33 +00:00
54a9b4c5c4 Update to Factorio 0.18.29 2020-06-01 19:03:38 +00:00
775ed4b228 Update to Factorio 0.18.28 2020-05-28 16:17:12 +00:00
5550f9b707 Update to Factorio 0.18.27 2020-05-26 15:12:19 +00:00
0c924152a7 Correctly check UPDATE_MODS_ON_START env
Closes #323
2020-05-25 03:21:17 +02:00
cb36026261 Update to Factorio 0.18.26 2020-05-23 01:26:01 +00:00
ef6bbde78d Fix migration when config is mounted (#318) 2020-05-23 03:05:56 +02:00
44d4898862 Update to Factorio 0.18.25 2020-05-19 11:40:16 +00:00
46b94cb19f ci: Fix incremental push 2020-05-18 04:08:29 +02:00
e47431c7af ci: fix dependabot condition 2020-05-18 04:08:18 +02:00
d03fb43532 ci: unbrick incremental tags 2020-05-18 03:56:55 +02:00
bd6d956518 ci: fix crash on empty vars 2020-05-18 03:50:08 +02:00
afd636fc3f ci: don't push on master, only tags 2020-05-18 03:09:14 +02:00
a2849b016a ci: improve doc 2020-05-18 03:04:12 +02:00
4e261043cd CI: simplify logic 2020-05-18 02:43:06 +02:00
4c47dbc4ee CI: Also disable docker push for branches 2020-05-18 02:42:55 +02:00
07264e626f Update all base images to alpine 3.11 2020-05-18 02:42:35 +02:00
64a1f8d9bf Replace symlinks with config option write-data
Closes #311
2020-05-18 02:36:26 +02:00
15a2d493f8 apply shellcheck suggestions 2020-05-18 02:34:53 +02:00
3777041d3e CI: disable branch tagging to fix dependabot 2020-05-18 02:21:47 +02:00
ccd0707d21 update alpine-glibc image to 3.11 (#312) 2020-05-18 01:25:03 +02:00
a5b03e6625 Update to Factorio 0.18.24 2020-05-12 13:45:50 +00:00
03b4d9eb5e Update to Factorio 0.18.23 2020-05-12 12:10:51 +00:00
af48272100 Fix shellcheck warnings, change shebang to bash 2020-05-07 22:31:20 +02:00
cc63e10cd1 Vendor docker hub update script 2020-05-07 22:30:58 +02:00
f90cd27bcd Update to Factorio 0.18.22 2020-04-30 12:05:50 +00:00
1ab01d0277 Fix save file environment variables in README.md. (#309) 2020-04-26 11:12:11 +02:00
66c11b1a82 Update to Factorio 0.18.21 2020-04-24 09:33:13 +00:00
49055cfe1b Update to Factorio 0.18.20 2020-04-24 06:43:20 +00:00
ab818efda4 Update to Factorio 0.18.19 2020-04-20 11:53:15 +00:00
6da1250b5b Update to Factorio 0.18.18 2020-04-08 16:02:54 +00:00
deaaf83967 Do not stop updating process on incompatible version
Closes #308
2020-04-05 11:09:01 +02:00
9691472b84 Backport #307 to 0.17 2020-04-05 11:07:18 +02:00
236b27d94e Update to Factorio 0.18.17 2020-03-27 17:58:41 +00:00
457ab79b5b Update to Factorio 0.18.16 2020-03-25 16:00:10 +00:00
Kai
235a2abb60 Fixes #306 by skipping custom mods (#307) 2020-03-21 12:54:27 +01:00
c52f649b35 Update to Factorio 0.18.15 2020-03-20 15:25:07 +00:00
52167abffa Update to Factorio 0.18.14 2020-03-18 17:20:08 +00:00
f20fe0ad85 Update to Factorio 0.18.13 2020-03-17 14:10:20 +00:00
1cd2015cc4 Update to Factorio 0.18.12 2020-03-10 17:45:07 +00:00
c4b2d30366 Update to Factorio 0.18.11 2020-03-10 15:05:07 +00:00
5c81134430 Update to Factorio 0.18.10 2020-03-03 14:30:08 +00:00
7d220042a9 Update to Factorio 0.18.9 2020-02-25 12:30:39 +00:00
e61a3aa622 Update to Factorio 0.18.8 2020-02-18 18:05:11 +00:00
773005b320 Update to Factorio 0.18.7 2020-02-18 15:15:10 +00:00
51185620dd Update to Factorio 0.18.6 2020-02-11 21:21:35 +00:00
c24b7bc41b Update to Factorio 0.18.5 2020-02-11 18:02:10 +00:00
5301aff1b1 Update to Factorio 0.18.4 2020-02-06 14:31:36 +00:00
502f13c1cd Update to Factorio 0.18.3 2020-01-30 18:56:34 +00:00
fe3d0d65bc Update to Factorio 0.18.2 2020-01-28 14:46:33 +00:00
4bc30e718c ⬆️ 0.18.1 2020-01-24 10:47:48 +01:00
994a091595 Don't update dockerhub on pull requests 2020-01-24 10:43:25 +01:00
c754e64e47 ⬇️ 0.18.0 2020-01-24 10:39:46 +01:00
a2726704ed Update to Factorio 0.18.0 and 0.18.1 (#303)
* Update to Factorio 0.18.0

* Update to Factorio 0.18.1
2020-01-24 10:37:42 +01:00
f4e8b30e90 Travis: Remove deprecated option 2019-12-26 16:05:09 +01:00
07dcd690bd Add updater status badge 2019-12-19 12:02:04 +01:00
4bf909979a Remove very out of date env section, format 2019-11-25 08:43:10 +01:00
7ec79a6e1b Allow configuring factorio server to run with a specific save th… (#296)
This change enables specifying a specific save to use via the $SAVE_NAME
variable when $ENABLE_SERVER_LOAD_LATEST is false. Additionally, you can
set $ENABLE_GENERATE_NEW_MAP_SAVE to generate a map for $SAVE_NAME if
one does not already exist.

Co-authored-by: Chance Zibolski <czibolsk@redhat.com>
2019-11-25 08:31:28 +01:00
6a1317cb7a Clear env for cleaner job list 2019-11-25 01:51:05 +01:00
15efa9caec Fix Docker HUB description update for PRs 2019-11-25 01:48:55 +01:00
41b2c9b743 Update contributors
Shameless self promotion 😝
2019-11-25 01:34:30 +01:00
4e4810aea3 Combine stages for faster pipeline 2019-11-20 22:57:13 +01:00
d667a247e1 Fix typo 2019-11-20 22:53:23 +01:00
ce1f980525 Make 0.17.79 stable
Closes #295
2019-11-20 22:47:20 +01:00
120ee1bbdb Update to Factorio 0.17.79 2019-11-19 18:43:06 +00:00
5cba3991ef Fix stable version in readme 2019-11-19 15:55:10 +01:00
412c16e379 Update to Factorio 0.17.79 2019-11-19 14:32:54 +00:00
82635a9cff Update to Factorio 0.17.78 2019-11-15 17:48:02 +00:00
c495fc38a4 Update to Factorio 0.17.77 2019-11-14 20:10:02 +00:00
b580447de4 Update Docker Hub Description 2019-11-11 22:21:45 +01:00
2290034ecf Update to Factorio 0.17.76 2019-11-10 02:29:36 +01:00
300300e7ec Fix stable tag 2019-11-07 00:27:02 +01:00
179be082d9 Update to Factorio 0.17.75 2019-11-07 00:22:42 +01:00
efcc29cfed Mod Updater: Force remove mod archives
Closes #293
2019-11-04 16:12:49 +01:00
1b7decd8ce Mark 0.17 stable 2019-11-01 10:15:23 +01:00
b38750e4ac Update to Factorio 0.17.74 2019-10-25 15:17:09 +00:00
bfb8b7fd95 Update to Factorio 0.17.73 2019-10-24 18:30:51 +00:00
8b5d4e06df Update to Factorio 0.17.72 2019-10-18 13:08:58 +00:00
33060cc4fb Update readme 2019-10-18 11:56:15 +02:00
e1beb32f81 Fix CI 2019-10-18 11:56:07 +02:00
2c1d1cd985 Fix CI
hopefully!
2019-10-18 11:52:25 +02:00
39fd391e9b Fix ci script for manual runs 2019-10-18 11:37:43 +02:00
a5d6466f0b Fix variable expansion 2019-10-18 11:21:15 +02:00
c6b15d89c1 Fix shellcheck 2019-10-18 11:15:36 +02:00
7c9011dcee Add note for when 0.17 leaves experimental entirely 2019-10-18 10:53:16 +02:00
b5af3130e2 Format 2019-10-18 10:51:06 +02:00
e307b1d537 CI: Add support for comma seperated extra tags 2019-10-18 10:50:25 +02:00
8c0ddf99ce Update to Factorio 0.17.71 2019-10-16 16:06:48 +00:00
d7b79c567a Update to Factorio 0.17.70 2019-10-15 20:20:03 +00:00
3e62698b4b Update store links 2019-10-01 16:25:31 +02:00
d4870219f6 Added a link to Gog in addition to Factorio's website and Steam in the README.md (#290) 2019-10-01 11:48:30 +02:00
01194242b9 Update to Factorio 0.17.69 2019-09-19 15:32:52 +00:00
41 changed files with 4830 additions and 204 deletions

27
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,27 @@
version: 2
updates:
- package-ecosystem: docker
directory: "/0.18"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/0.17"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/0.16"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/0.15"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: docker
directory: "/0.14"
schedule:
interval: daily
open-pull-requests-limit: 10

View File

@ -0,0 +1,18 @@
name: Docker build & push
on:
push:
branches: master
jobs:
docker-description:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2.4.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: factoriotools/factorio

53
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Docker build & push
on:
pull_request:
push:
branches: master
tags:
- '*'
jobs:
old-version:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "1.0", "0.17", "0.16", "0.15", "0.14" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: build
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
VERSION_SHORT: ${{ matrix.version }}
run: |
./build.sh ${{ matrix.version }}
stable:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: build
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
EXTRA_TAG: stable,latest
VERSION_SHORT: "1.1"
run: |
./build.sh $VERSION_SHORT
# experimental:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: build
# env:
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# EXTRA_TAG: latest
# VERSION_SHORT: "1.2"
# run: |
# ./build.sh $VERSION_SHORT

27
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: 'Linter'
on:
pull_request:
push:
branches: master
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: hadolint
uses: reviewdog/action-hadolint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review

View File

@ -1,27 +0,0 @@
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,4 +1,4 @@
FROM frolvlad/alpine-glibc:alpine-3.9
FROM frolvlad/alpine-glibc:alpine-3.13
LABEL maintainer="https://github.com/factoriotools/factorio-docker"

View File

@ -1,4 +1,4 @@
FROM frolvlad/alpine-glibc:alpine-3.9
FROM frolvlad/alpine-glibc:alpine-3.13
LABEL maintainer="https://github.com/factoriotools/factorio-docker"

View File

@ -1,4 +1,4 @@
FROM frolvlad/alpine-glibc:alpine-3.9
FROM frolvlad/alpine-glibc:alpine-3.13
LABEL maintainer="https://github.com/factoriotools/factorio-docker"

View File

@ -1,4 +1,4 @@
FROM frolvlad/alpine-glibc:alpine-3.9
FROM frolvlad/alpine-glibc:alpine-3.13
LABEL maintainer="https://github.com/factoriotools/factorio-docker"
@ -9,8 +9,8 @@ ARG PGID=845
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=0.17.68 \
SHA1=dac6b6b04d35b54c188a1313a321e19e4f02263e \
VERSION=0.17.79 \
SHA1=7f127baf3cf01c6e545a9ca376dec1ac37468f8a \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
@ -19,6 +19,7 @@ ENV PORT=34197 \
PUID="$PUID" \
PGID="$PGID"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -ox pipefail \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \
@ -29,18 +30,16 @@ RUN set -ox pipefail \
&& tar xf "$archive" --directory /opt \
&& chmod ugo=rwx /opt/factorio \
&& rm "$archive" \
&& 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 \
&& ln -s "$SAVES" /opt/factorio/saves \
&& mkdir -p /opt/factorio/config/ \
&& addgroup -g "$PGID" -S "$GROUP" \
&& adduser -u "$PUID" -G "$GROUP" -s /bin/sh -SDH "$USER" \
&& chown -R "$USER":"$GROUP" /opt/factorio /factorio
COPY files/*.sh /
COPY files/config.ini /opt/factorio/config/config.ini
VOLUME /factorio
EXPOSE $PORT/udp $RCON_PORT/tcp
COPY files/ /
ENTRYPOINT ["/docker-entrypoint.sh"]

714
0.17/files/config.ini Normal file
View File

@ -0,0 +1,714 @@
; version=5
; This is INI file : https://en.wikipedia.org/wiki/INI_file#Format
; Semicolons (;) at the beginning of the line indicate a comment. Comment lines are ignored.
[path]
read-data=__PATH__executable__/../../data
write-data=__PATH__executable__/../..
[general]
locale=
[other]
; Options: true, false
; verbose-logging=false
; Options: true, false
; log-saving-statistics=false
; autosave-interval=5
; autosave-slots=3
; In ticks
; minimum-latency-in-multiplayer=0
; In seconds
; multiplayer-initial-connection-timeout=10
; port=34197
; max-map-preview-chunk-side=64
; max-map-preview-threads=7
; In bytes
; max-multiplayer-script-reload-size=1048576
; Options: true, false
; enable-steam-networking=true
; proxy=
; proxy-username=
; proxy-password=
; Options: true, false
; check-updates=true
; Options: true, false
; enable-experimental-updates=false
; Options: true, false
; enable-new-mods=true
; Options: true, false
; use-mod-settings-per-save=true
; Options: true, false
; disable-minimal-mode=false
; Options: true, false
; disable-blueprint-storage=false
; Disables tracking which mod created/changed what prototype. Mainly for faster startup during development.
;
; Options: true, false
; disable-prototype-history=false
; Print a warning for all prototype values that were not accessed.
;
; Options: true, false
; check-unused-prototype-data=false
; Options: true, false
; enable-razer-chroma-support=true
; Options: true, false
; enable-logitech-led-support=true
; Options: true, false
; enable-crash-log-uploading=true
; Options: true, false
; enable-heap-validation=true
; Options: true, false
; enable-threaded-message-pump=true
; Options: true, false
; enable-taskbar-animation=true
; Does nothing on Windows
;
; Options: true, false
; non-blocking-saving=false
; Related to MacOS
;
; Options: true, false
; discard-mouse-events-when-accessibility-zoomed=false
; Options: true, false
; enable-blueprint-storage-cloud-sync=false
; Options: fast, maximum
; multiplayer-compression-level=fast
; Options: none, fast, maximum
; autosave-compression-level=fast
; Socket to host RCON on when lauching MP server from the menu.
; local-rcon-socket=0.0.0.0:0
; Password for RCON when launching MP server from the menu.
; local-rcon-password=
[interface]
; Options: true, false
; automatic-ui-scale=true
; custom-ui-scale=1.000000
; tooltip-delay=0.040000
; entity-tooltip-delay=0.000000
; tooltip-offset=20
; output-console-delay=1200
; train-stop-label-angle=0.085526
; active-quick-bars=2
; shortcut-bar-rows=2
; Options: true, false
; force-default-logistic-filter-count-to-one=false
; Options: true, false
; autosort-inventory=true
; Options: true, false
; research-finished-stops-game=false
; Options: true, false
; use-item-groups=true
; Options: true, false
; use-item-subgroups=true
; Options: true, false
; use-version-filter-in-browse-games-gui=true
; Options: true, false
; use-version-filter-in-install-mods-gui=true
; Options: true, false
; play-sound-for-chat-messages=true
; Options: true, false
; fuzzy-search-enabled=false
; Options: true, false
; pick-ghost-cursor=false
; Options: true, false
; show-minimap=true
; Options: true, false
; show-tips-and-tricks=true
; Options: true, false
; show-tutorial-notifications=true
; Options: true, false
; show-turret-radius-when-blueprinting=false
; Options: true, false
; show-item-labels-in-cursor=true
; Options: true, false
; show-rail-block-visualization=true
; Options: true, false
; show-missing-logistic-network-icon=true
; Options: true, false
; show-interaction-indications=true
; Options: true, false
; show-grid-when-paused=true
; Options: true, false
; show-inserter-arrows-when-selected=true
; Options: true, false
; show-inserter-arrows-when-detailed-info-is-on=false
; Options: true, false
; show-pump-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-mining-drill-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-combinator-settings-when-detailed-info-is-on=false
; Options: true, false
; entity-tooltip-on-the-side=true
; Options: true, false
; show-mod-owners-in-tooltips=true
; Options: true, false
; show-descriptions-in-tooltips=true
; Options: true, false
; show-total-raw-in-recipe-tooltips=true
; debug-font-size=18
; train-visualization-length=5
[sound]
; master-volume=0.600000
; music-volume=0.400000
; game-effects-volume=0.700000
; gui-effects-volume=0.700000
; walking-sound-volume=0.300000
; environment-sounds-volume=0.450000
; alerts-volume=0.550000
; wind-volume=0.400000
; audible-distance=40.000000
; environment-audible-distance=15.000000
; maximum-environment-sounds=15
; active-gui-volume-modifier=1.000000
; active-gui-environment-volume-modifier=0.600000
; ambient-music-pause-mean-seconds=45.000000
; ambient-music-pause-variance-seconds=30.000000
; Options: main-tracks-only, interleave-main-tracks-with-interludes, randomize-all
; ambient-music-mode=interleave-main-tracks-with-interludes
; zoom-audible-distance-coefficient=1.000000
; zoom-volume-coefficient=2.000000
[map-view]
; Options: true, false
; show-logistic-network=false
; Options: true, false
; show-electric-network=false
; Options: true, false
; show-turret-range=false
; Options: true, false
; show-pollution=true
; Options: true, false
; show-networkless-logistic-members=false
; Options: true, false
; show-train-station-names=true
; Options: true, false
; show-player-names=true
; Options: true, false
; show-non-standard-map-info=false
[debug]
; force=enemy
; Options: true, false
; capture-perf-statistics=false
; Options: always, debug, never
; show-fps=debug
; Options: always, debug, never
; show-detailed-info=debug
; Options: always, debug, never
; show-time-usage=debug
; Options: always, debug, never
; show-gpu-time-usage=debug
; Options: always, debug, never
; show-sprite-counts=never
; Options: always, debug, never
; show-lua-object-statistics=never
; Options: always, debug, never
; show-multiplayer-waiting-icon=debug
; Options: always, debug, never
; show-multiplayer-statistics=debug
; Options: always, debug, never
; show-multiplayer-selection-rectangles=never
; Options: always, debug, never
; show-debug-info-in-tooltips=debug
; Options: always, debug, never
; hide-mod-guis=never
; Options: always, debug, never
; show-tile-grid=never
; Options: always, debug, never
; show-collision-rectangles=never
; Options: always, debug, never
; show-selection-rectangles=never
; Options: always, debug, never
; show-render-rectangles=never
; Options: always, debug, never
; show-entity-positions=never
; Options: always, debug, never
; show-entity-velocities=never
; Options: always, debug, never
; show-selected-entity-advanced-tiles=never
; Options: always, debug, never
; show-selected-input-transport-belts=never
; Options: always, debug, never
; show-paths=never
; Options: always, debug, never
; show-path-requests=never
; Options: always, debug, never
; show-next-waypoint-bb=never
; Options: always, debug, never
; show-target=never
; Options: always, debug, never
; show-unit-group-info=never
; Options: always, debug, never
; show-unit-behavior-info=never
; Options: always, debug, never
; show-pathfinder-fringe=never
; Options: always, debug, never
; show-path-cache=never
; Options: always, debug, never
; show-path-cache-paths=never
; Options: always, debug, never
; show-rail-paths=never
; Options: always, debug, never
; show-rolling-stock-count=never
; Options: always, debug, never
; show-rail-connections=never
; Options: always, debug, never
; show-rail-joints=never
; Options: always, debug, never
; show-rail-signal-states=never
; Options: always, debug, never
; show-rail-segment-collision-boxes=never
; Options: always, debug, never
; show-train-stop-point=never
; Options: always, debug, never
; show-train-braking-distance=never
; Options: always, debug, never
; show-train-signals=never
; Options: always, debug, never
; show-train-repathing=never
; Options: always, debug, never
; show-network-connected-entities=never
; Options: always, debug, never
; show-circuit-network-numbers=never
; Options: always, debug, never
; show-energy-sources-networks=never
; Options: always, debug, never
; show-active-state=never
; Options: always, debug, never
; show-wakeup-lists=never
; Options: always, debug, never
; show-transport-lines=never
; Options: always, debug, never
; show-transport-line-gaps=never
; Options: always, debug, never
; show-pollution-values=never
; Options: always, debug, never
; show-active-entities-on-chunk-counts=never
; Options: always, debug, never
; show-active-chunks=never
; Options: always, debug, never
; show-polluted-chunks=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunks=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunk-values=never
; Options: always, debug, never
; show-bad-attack-chunks=never
; Options: always, debug, never
; show-tile-variations=never
; Options: always, debug, never
; show-raw-tile-transitions=never
; Options: always, debug, never
; show-fluid-box-fluid-info=never
; Options: always, debug, never
; show-environment-sound-info=never
; Options: always, debug, never
; show-logistic-robot-targets=never
; Options: always, debug, never
; show-logistic-robots-on-map=never
; Options: always, debug, never
; show-recipe-icons-on-map=never
; Options: always, debug, never
; show-player-robots=never
; Options: always, debug, never
; show-fire-info=never
; Options: always, debug, never
; show-sticker-info=never
; Options: always, debug, never
; show-decorative-names=never
; Options: always, debug, never
; show-decorative-collision-rectangles=never
; Options: always, debug, never
; allow-increased-zoom=never
; Options: always, debug, never
; show-chunk-components=never
[multiplayer-lobby]
; name=
; description=
; Options: true, false
; visibility-public=true
; Options: true, false
; visibility-steam=true
; Options: true, false
; visibility-lan=true
; max-players=0
; Options: true, false
; ignore-player-limit-when-returning=false
; max-upload-in-kilobytes-per-second=0
; max-upload-slots=5
; password=
; tag-list=
; afk-auto-kick=0
; Options: true, false, admins-only
; allowed-commands=admins-only
; Options: true, false
; only-admins-can-pause=true
; Options: true, false
; autosave-only-on-server=true
; Options: true, false
; non-blocking-saving=true
; Options: true, false
; verify-user-identity=true
; Options: true, false
; enable-whitelist=false
[graphics]
; lights-render-quality=0.250000
; Default preferred display index should force finding primary monitor
; preferred-display-index=255
; screenshots-threads-count=8
; cache-sprite-atlas-count=1
; Options: true, false
; cache-sprite-atlas=false
; Options: true, false
; compress-sprite-atlas-cache=false
; Options: true, false
; texture-streaming=true
; streamed-atlas-physical-vram-size=0
; sprite-vertex-buffer-size=1048576
; max-texture-size=0
; max-threads=8
; 'low' and 'very-low' options are deprecated and will be migrated to 'normal'
;
; Options: high, normal, low, very-low
; graphics-quality=normal
; Options: true, false
; full-screen=true
; Options: true, false
; minimize-on-focus-loss=false
; Options: true, false
; show-smoke=true
; Options: true, false
; show-clouds=true
; Options: true, false
; show-decoratives=true
; Options: true, false
; show-item-shadows=true
; Options: true, false
; show-inserter-shadows=true
; Options: true, false
; force-opengl=false
; Options: true, false
; v-sync=true
; Options: true, false
; high-quality-animations=true
; Options: true, false
; high-quality-shadows=false
; Options: true, false
; high-quality-terrain=true
; Minimum number of turrets required to turn on the turret range overdraw optimization
; turret-overdraw-minimum-count=4
; Scale at which the turret range overdraw optimization will start being applied
; turret-overdraw-scale-threshold=0.200000
; Options: true, false
; skip-vram-detection=false
; Options: true, false
; halt-rendering-when-minimized=true
; Options: true, false
; runtime-sprite-reload=false
; Options: true, false
; full-color-depth=true
; Options: true, false
; render-in-native-resolution=true
; Options: true, false
; use-flip-presentation-model=false
; Options: true, false
; debug-api=false
; Options: true, false
; discard-buffers-on-begin-frame=true
; Options: all, high, medium, low
; video-memory-usage=high
; Options: none, high-quality, low-quality
; texture-compression-level=high-quality
; Options: true, false
; compress-virtual-atlas=true
; Options: copy, copy-sequential, flip, flip-discard
; dxgi-presentation-model=copy
; Options: none, flush, wait-for-vblank, flush-and-wait-for-vblank
; dxgi-action-before-present=none
; relevant only for flip presentation models
;
; Options: true, false
; dxgi-allow-tearing=false
; Options: false, true, auto
; dxgi-flip-do-not-wait=false
; Options: true, false
; dxgi-present-restart=false
; dxgi-swap-chain-buffer-count=0
; dxgi-max-frame-latency=0
; dxgi-adapter-index=-1
; max-sprite-loading-threads=32
; Options: true, false
; gpu-accelerated-compression=true
; Options: true, false
; gpu-accelerated-mipmap-compression=true
; Options: true, false
; wait-until-mipmap-generation-finished=true
; Options: true, false
; check-for-unused-pixels=false
; ogl-depth-buffer-bit-depth=0
; Options: false, true, auto
; ogl-accelerated-renderer=auto
; Options: true, false
; ogl-double-buffered=true
; Set to true if mipmapped sprites render very blurry on your GPU. Limited support.
;
; Options: true, false
; legacy-gpu-no-mipmaps=false
; Options: true, false
; force-linear-magnification=false
; Options: true, false
; custom-mipmap-workaround=false
; Options: true, false
; buffer-rename-workaround=false
; Comma separated list of OpenGL extensions that should not be used (for example: ARB_copy_image,KHR_debug)
; disabled-opengl-extensions=

View File

@ -2,6 +2,10 @@
set -eoux pipefail
FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
SAVE_NAME="${SAVE_NAME:-""}"
mkdir -p "$FACTORIO_VOL"
mkdir -p "$SAVES"
mkdir -p "$CONFIG"
@ -33,7 +37,7 @@ if [[ $NRTMPSAVES -gt 0 ]]; then
rm -f "$SAVES"/*.tmp.zip
fi
if [[ ${UPDATE_MODS_ON_START:-} ]]; then
if [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
./docker-update-mods.sh
fi
@ -49,19 +53,31 @@ else
SU_EXEC=""
fi
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
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"
if [[ $GENERATE_NEW_SAVE != true && $NRSAVES == 0 ]]; then
GENERATE_NEW_SAVE=true
SAVE_NAME=_autosave1
fi
# shellcheck disable=SC2086
exec $SU_EXEC /opt/factorio/bin/x64/factorio \
if [[ $GENERATE_NEW_SAVE == true ]]; then
if [[ -z "$SAVE_NAME" ]]; then
echo "If \$GENERATE_NEW_SAVE is true, you must specify \$SAVE_NAME"
exit 1
fi
if [[ -f "$SAVES/$SAVE_NAME.zip" ]]; then
echo "Map $SAVES/$SAVE_NAME.zip already exists, skipping map generation"
else
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/$SAVE_NAME.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
fi
FLAGS=(\
--port "$PORT" \
--start-server-load-latest \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--rcon-port "$RCON_PORT" \
@ -70,4 +86,13 @@ exec $SU_EXEC /opt/factorio/bin/x64/factorio \
--server-adminlist "$CONFIG/server-adminlist.json" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json \
"$@"
)
if [[ $LOAD_LATEST_SAVE == true ]]; then
FLAGS+=( --start-server-load-latest )
else
FLAGS+=( --start-server "$SAVE_NAME" )
fi
# shellcheck disable=SC2086
exec $SU_EXEC /opt/factorio/bin/x64/factorio "${FLAGS[@]}" "$@"

View File

@ -5,7 +5,7 @@ if [[ -f /run/secrets/username ]]; then
USERNAME=$(cat /run/secrets/username)
fi
if [[ -f /run/secrets/username ]]; then
if [[ -f /run/secrets/token ]]; then
TOKEN=$(cat /run/secrets/token)
fi

View File

@ -32,6 +32,8 @@ fi
exec /opt/factorio/bin/x64/factorio \
--port "$PORT" \
--start-server-load-scenario "$SERVER_SCENARIO" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-whitelist "$CONFIG/server-whitelist.json" \

View File

@ -25,26 +25,28 @@ print_failure()
update_mod()
{
MOD_NAME="${1// /%20}"
MOD_NAME="$1"
MOD_NAME_ENCODED="${1// /%20}"
print_step "Checking for update of mod $MOD_NAME..."
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME"
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
print_success " Custom mod not on $MOD_BASE_URL, skipped."
return 0
fi
MOD_INFO=$(echo "$MOD_INFO_JSON" | jq -j --arg version "$FACTORIO_VERSION" ".releases|reverse|map(select(.info_json.factorio_version as \$mod_version | \$version | startswith(\$mod_version)))[0]|.file_name, \";\", .download_url, \";\", .sha1")
MOD_FILENAME=$(echo "$MOD_INFO" | cut -f1 -d";")
MOD_URL=$(echo "$MOD_INFO" | cut -f2 -d";")
MOD_SHA1=$(echo "$MOD_INFO" | cut -f3 -d";")
if [[ -z $MOD_URL ]]; then
return 1
fi
if [[ $MOD_FILENAME == null ]]; then
print_failure " Not compatible with version"
return 1
return 0
fi
if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then
@ -58,7 +60,7 @@ update_mod()
if [[ $HTTP_STATUS != 200 ]]; then
print_failure " Download failed: Code $HTTP_STATUS."
rm "$MOD_DIR/$MOD_FILENAME"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
@ -69,7 +71,7 @@ update_mod()
if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then
print_failure " SHA1 mismatch!"
rm "$MOD_DIR/$MOD_FILENAME"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
@ -78,7 +80,7 @@ update_mod()
for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761
if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Deleting old version: $file"
rm "$file"
rm -f "$file"
fi
done

45
0.18/Dockerfile Normal file
View File

@ -0,0 +1,45 @@
FROM frolvlad/alpine-glibc:alpine-3.13
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.18.47 \
SHA1=96eccc1c7bb59abbfa6a04d13762dcf86c8ef9cf \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
SCRIPTOUTPUT=/factorio/script-output \
PUID="$PUID" \
PGID="$PGID"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -ox pipefail \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \
&& apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \
&& curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" \
&& echo "$SHA1 $archive" | sha1sum -c \
|| (sha1sum "$archive" && file "$archive" && exit 1) \
&& tar xf "$archive" --directory /opt \
&& chmod ugo=rwx /opt/factorio \
&& rm "$archive" \
&& ln -s "$SCENARIOS" /opt/factorio/scenarios \
&& ln -s "$SAVES" /opt/factorio/saves \
&& mkdir -p /opt/factorio/config/ \
&& addgroup -g "$PGID" -S "$GROUP" \
&& adduser -u "$PUID" -G "$GROUP" -s /bin/sh -SDH "$USER" \
&& chown -R "$USER":"$GROUP" /opt/factorio /factorio
COPY files/*.sh /
COPY files/config.ini /opt/factorio/config/config.ini
VOLUME /factorio
EXPOSE $PORT/udp $RCON_PORT/tcp
ENTRYPOINT ["/docker-entrypoint.sh"]

15
0.18/docker-compose.yml Normal file
View File

@ -0,0 +1,15 @@
version: '2'
services:
factorio:
build: .
ports:
- "34197:34197/udp"
- "27015:27015/tcp"
volumes:
- /opt/factorio:/factorio
# environment:
# - PUID=1000
# - PGID=1000
# - UPDATE_MODS_ON_START=true
# - USERNAME=FactorioUsername
# - TOKEN=FactorioToken

755
0.18/files/config.ini Normal file
View File

@ -0,0 +1,755 @@
; version=8
; This is INI file : https://en.wikipedia.org/wiki/INI_file#Format
; Semicolons (;) at the beginning of the line indicate a comment. Comment lines are ignored.
[path]
read-data=__PATH__executable__/../../data
write-data=__PATH__executable__/../..
[general]
locale=
[other]
; Options: true, false
; verbose-logging=false
; Options: true, false
; log-saving-statistics=false
; autosave-interval=5
; autosave-slots=3
; In ticks
; minimum-latency-in-multiplayer=0
; In seconds
; multiplayer-initial-connection-timeout=10
; port=34197
; max-map-preview-chunk-side=64
; max-map-preview-threads=7
; In bytes
; max-multiplayer-script-reload-size=1048576
; Options: true, false
; enable-steam-networking=true
; proxy=
; proxy-username=
; proxy-password=
; Options: true, false
; check-updates=true
; Options: true, false
; enable-experimental-updates=false
; Options: true, false
; enable-new-mods=true
; Options: true, false
; use-mod-settings-per-save=true
; Options: true, false
; disable-minimal-mode=false
; Options: true, false
; disable-blueprint-storage=false
; Disables tracking which mod created/changed what prototype. Mainly for faster startup during development.
;
; Options: true, false
; disable-prototype-history=false
; Print a warning for all prototype values that were not accessed.
;
; Options: true, false
; check-unused-prototype-data=false
; Cache data stage prototype data for faster startup. Experimental.
;
; Options: true, false
; cache-prototype-data=false
; Options: true, false
; enable-razer-chroma-support=true
; Options: true, false
; enable-logitech-led-support=true
; Options: true, false
; enable-crash-log-uploading=true
; Options: true, false
; enable-heap-validation=true
; Options: true, false
; enable-threaded-message-pump=true
; Options: true, false
; enable-taskbar-animation=true
; Does nothing on Windows
;
; Options: true, false
; non-blocking-saving=false
; Related to MacOS
;
; Options: true, false
; discard-mouse-events-when-accessibility-zoomed=false
; Options: true, false
; enable-blueprint-storage-cloud-sync=false
; Options: true, false
; force-enable-factorio-version-check=false
; Options: true, false
; bring-window-to-top-on-click=true
; Options: fast, maximum
; multiplayer-compression-level=fast
; Options: none, fast, maximum
; autosave-compression-level=fast
; Socket to host RCON on when lauching MP server from the menu.
; local-rcon-socket=0.0.0.0:0
; Password for RCON when launching MP server from the menu.
; local-rcon-password=
[interface]
; Options: true, false
; automatic-ui-scale=true
; custom-ui-scale=1.000000
; tooltip-delay=0.040000
; entity-tooltip-delay=0.000000
; tooltip-offset=20
; output-console-delay=1200
; train-stop-label-angle=0.085526
; active-quick-bars=2
; shortcut-bar-rows=2
; Options: true, false
; autosort-inventory=true
; Options: true, false
; research-finished-stops-game=false
; Options: true, false
; use-item-groups=true
; Options: true, false
; use-item-subgroups=true
; Options: true, false
; use-version-filter-in-browse-games-gui=true
; Options: true, false
; use-version-filter-in-install-mods-gui=true
; Options: true, false
; play-sound-for-chat-messages=true
; Options: true, false
; fuzzy-search-enabled=false
; Options: true, false
; pick-ghost-cursor=false
; Options: true, false
; show-minimap=true
; Options: true, false
; show-tips-and-tricks=true
; Options: true, false
; show-tutorial-notifications=true
; Options: true, false
; show-turret-radius-when-blueprinting=false
; Options: true, false
; show-item-labels-in-cursor=true
; Options: true, false
; show-rail-block-visualization=true
; Options: true, false
; show-missing-logistic-network-icon=true
; Options: true, false
; show-interaction-indications=true
; Options: true, false
; show-grid-when-paused=true
; Options: true, false
; show-inserter-arrows-when-selected=true
; Options: true, false
; show-inserter-arrows-when-detailed-info-is-on=false
; Options: true, false
; show-pump-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-mining-drill-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-combinator-settings-when-detailed-info-is-on=false
; Options: true, false
; entity-tooltip-on-the-side=true
; Options: true, false
; show-mod-owners-in-tooltips=true
; Options: true, false
; show-descriptions-in-tooltips=true
; Options: true, false
; show-total-raw-in-recipe-tooltips=true
; debug-font-size=18
; train-visualization-length=5
[sound]
; master-volume=0.800000
; music-volume=0.500000
; game-effects-volume=0.700000
; gui-effects-volume=0.600000
; walking-sound-volume=0.250000
; environment-sounds-volume=0.550000
; alerts-volume=0.500000
; wind-volume=0.350000
; audible-distance=40.000000
; environment-audible-distance=30.000000
; maximum-environment-sounds=50
; active-gui-volume-modifier=0.800000
; active-gui-environment-volume-modifier=0.400000
; The maximum volume allowed for any sound.
; maximum-volume=2.000000
; ambient-music-pause-mean-seconds=45.000000
; ambient-music-pause-variance-seconds=30.000000
; Options: main-tracks-only, interleave-main-tracks-with-interludes, randomize-all
; ambient-music-mode=interleave-main-tracks-with-interludes
; zoom-audible-distance-coefficient=0.500000
; zoom-volume-coefficient=0.750000
[map-view]
; Options: true, false
; show-logistic-network=false
; Options: true, false
; show-electric-network=false
; Options: true, false
; show-turret-range=false
; Options: true, false
; show-pollution=true
; Options: true, false
; show-networkless-logistic-members=false
; Options: true, false
; show-train-station-names=true
; Options: true, false
; show-player-names=true
; Options: true, false
; show-non-standard-map-info=false
[debug]
; force=enemy
; Options: true, false
; capture-perf-statistics=false
; Options: always, debug, never
; show-fps=debug
; Options: always, debug, never
; show-detailed-info=debug
; Options: always, debug, never
; show-time-usage=debug
; Options: always, debug, never
; show-gpu-time-usage=debug
; Options: always, debug, never
; show-sprite-counts=never
; Options: always, debug, never
; show-lua-object-statistics=never
; Options: always, debug, never
; show-heat-buffer-info=never
; Options: always, debug, never
; show-multiplayer-waiting-icon=debug
; Options: always, debug, never
; show-multiplayer-statistics=debug
; Options: always, debug, never
; show-multiplayer-selection-rectangles=never
; Options: always, debug, never
; show-debug-info-in-tooltips=debug
; Options: always, debug, never
; hide-mod-guis=never
; Options: always, debug, never
; show-tile-grid=never
; Options: always, debug, never
; show-collision-rectangles=never
; Options: always, debug, never
; show-selection-rectangles=never
; Options: always, debug, never
; show-render-rectangles=never
; Options: always, debug, never
; show-entity-positions=never
; Options: always, debug, never
; show-entity-velocities=never
; Options: always, debug, never
; show-selected-entity-advanced-tiles=never
; Options: always, debug, never
; show-selected-input-transport-belts=never
; Options: always, debug, never
; show-paths=never
; Options: always, debug, never
; show-path-requests=never
; Options: always, debug, never
; show-next-waypoint-bb=never
; Options: always, debug, never
; show-target=never
; Options: always, debug, never
; show-unit-group-info=never
; Options: always, debug, never
; show-unit-behavior-info=never
; Options: always, debug, never
; show-pathfinder-fringe=never
; Options: always, debug, never
; show-path-cache=never
; Options: always, debug, never
; show-path-cache-paths=never
; Options: always, debug, never
; show-rail-paths=never
; Options: always, debug, never
; show-rolling-stock-count=never
; Options: always, debug, never
; show-rail-connections=never
; Options: always, debug, never
; show-rail-joints=never
; Options: always, debug, never
; show-rail-signal-states=never
; Options: always, debug, never
; show-rail-segment-collision-boxes=never
; Options: always, debug, never
; show-train-stop-point=never
; Options: always, debug, never
; show-train-braking-distance=never
; Options: always, debug, never
; show-train-signals=never
; Options: always, debug, never
; show-train-repathing=never
; Options: always, debug, never
; show-network-connected-entities=never
; Options: always, debug, never
; show-circuit-network-numbers=never
; Options: always, debug, never
; show-energy-sources-networks=never
; Options: always, debug, never
; show-active-state=never
; Options: always, debug, never
; show-wakeup-lists=never
; Options: always, debug, never
; show-transport-lines=never
; Options: always, debug, never
; show-transport-line-gaps=never
; Options: always, debug, never
; show-pollution-values=never
; Options: always, debug, never
; show-active-entities-on-chunk-counts=never
; Options: always, debug, never
; show-active-chunks=never
; Options: always, debug, never
; show-polluted-chunks=never
; Options: always, debug, never
; hide-chart-tags=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunks=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunk-values=never
; Options: always, debug, never
; show-bad-attack-chunks=never
; Options: always, debug, never
; show-tile-variations=never
; Options: always, debug, never
; show-raw-tile-transitions=never
; Options: always, debug, never
; show-fluid-box-fluid-info=never
; Options: always, debug, never
; show-environment-sound-info=never
; Options: always, debug, never
; show-environment-sound-area=never
; Options: always, debug, never
; show-selected-entity-audible-range=never
; Options: always, debug, never
; show-recently-played-sound-info=never
; Options: always, debug, never
; show-logistic-robot-targets=never
; Options: always, debug, never
; show-logistic-robots-on-map=never
; Options: always, debug, never
; show-recipe-icons-on-map=never
; Options: always, debug, never
; show-player-robots=never
; Options: always, debug, never
; show-fire-info=never
; Options: always, debug, never
; show-sticker-info=never
; Options: always, debug, never
; show-decorative-names=never
; Options: always, debug, never
; show-decorative-collision-rectangles=never
; Options: always, debug, never
; allow-increased-zoom=never
; Options: always, debug, never
; show-chunk-components=never
[multiplayer-lobby]
; name=
; description=
; Options: true, false
; visibility-public=true
; Options: true, false
; visibility-steam=true
; Options: true, false
; visibility-lan=true
; max-players=0
; Options: true, false
; ignore-player-limit-when-returning=false
; max-upload-in-kilobytes-per-second=0
; max-upload-slots=5
; password=
; tag-list=
; afk-auto-kick=0
; Options: true, false, admins-only
; allowed-commands=admins-only
; Options: true, false
; only-admins-can-pause=true
; Options: true, false
; autosave-only-on-server=true
; Options: true, false
; non-blocking-saving=true
; Options: true, false
; verify-user-identity=true
; Options: true, false
; enable-whitelist=false
[graphics]
; lights-render-quality=0.250000
; Default preferred display index should force finding primary monitor
; preferred-display-index=255
; screenshots-threads-count=8
; cache-sprite-atlas-count=1
; Options: true, false
; cache-sprite-atlas=false
; Options: true, false
; compress-sprite-atlas-cache=false
; Options: true, false
; texture-streaming=true
; streamed-atlas-physical-vram-size=0
; sprite-vertex-buffer-size=1048576
; max-texture-size=0
; max-threads=8
; 'low' and 'very-low' options are deprecated and will be migrated to 'normal'
;
; Options: high, normal, low, very-low
; graphics-quality=normal
; brightness=0
; contrast=0
; saturation=100
; Options: true, false
; full-screen=true
; Options: true, false
; minimize-on-focus-loss=false
; Options: true, false
; show-smoke=true
; Options: true, false
; show-clouds=true
; Options: true, false
; show-decoratives=true
; Options: true, false
; show-particles=true
; Options: true, false
; show-item-shadows=true
; Options: true, false
; show-inserter-shadows=true
; Options: true, false
; show-animated-water=true
; Options: true, false
; show-tree-distortion=true
; Options: true, false
; force-opengl=false
; Options: true, false
; v-sync=true
; Options: true, false
; high-quality-animations=true
; Options: true, false
; high-quality-shadows=false
; Options: true, false
; high-quality-terrain=true
; Minimum number of turrets required to turn on the turret range overdraw optimization
; turret-overdraw-minimum-count=4
; Scale at which the turret range overdraw optimization will start being applied
; turret-overdraw-scale-threshold=0.200000
; Options: true, false
; skip-vram-detection=false
; Options: true, false
; halt-rendering-when-minimized=true
; Options: true, false
; runtime-sprite-reload=false
; Options: true, false
; full-color-depth=true
; Options: true, false
; render-in-native-resolution=true
; Options: true, false
; use-flip-presentation-model=false
; Options: true, false
; debug-api=false
; Options: true, false
; discard-buffers-on-begin-frame=true
; Options: all, high, medium, low
; video-memory-usage=high
; Options: none, high-quality, low-quality
; texture-compression-level=high-quality
; Options: true, false
; compress-virtual-atlas=true
; Options: copy, copy-sequential, flip, flip-discard
; dxgi-presentation-model=copy
; Options: none, flush, wait-for-vblank, flush-and-wait-for-vblank
; dxgi-action-before-present=none
; relevant only for flip presentation models
;
; Options: true, false
; dxgi-allow-tearing=false
; Options: false, true, auto
; dxgi-flip-do-not-wait=false
; Options: true, false
; dxgi-present-restart=false
; dxgi-swap-chain-buffer-count=0
; dxgi-max-frame-latency=0
; dxgi-adapter-index=-1
; max-sprite-loading-threads=32
; Options: true, false
; gpu-accelerated-compression=true
; Options: true, false
; gpu-accelerated-mipmap-compression=true
; Options: true, false
; wait-until-mipmap-generation-finished=true
; Options: true, false
; check-for-unused-pixels=false
; ogl-depth-buffer-bit-depth=0
; Options: false, true, auto
; ogl-accelerated-renderer=auto
; Options: true, false
; ogl-double-buffered=true
; Set to true if mipmapped sprites render very blurry on your GPU. Limited support.
;
; Options: true, false
; legacy-gpu-no-mipmaps=false
; Options: true, false
; force-linear-magnification=false
; Options: true, false
; custom-mipmap-workaround=false
; Options: true, false
; buffer-rename-workaround=false
; Comma separated list of OpenGL extensions that should not be used (for example: ARB_copy_image,KHR_debug)
; disabled-opengl-extensions=

98
0.18/files/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,98 @@
#!/bin/bash
set -eoux pipefail
FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
SAVE_NAME="${SAVE_NAME:-""}"
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 [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
./docker-update-mods.sh
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
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
NRSAVES=$(find -L "$SAVES" -iname \*.zip -mindepth 1 | wc -l)
if [[ $GENERATE_NEW_SAVE != true && $NRSAVES == 0 ]]; then
GENERATE_NEW_SAVE=true
SAVE_NAME=_autosave1
fi
if [[ $GENERATE_NEW_SAVE == true ]]; then
if [[ -z "$SAVE_NAME" ]]; then
echo "If \$GENERATE_NEW_SAVE is true, you must specify \$SAVE_NAME"
exit 1
fi
if [[ -f "$SAVES/$SAVE_NAME.zip" ]]; then
echo "Map $SAVES/$SAVE_NAME.zip already exists, skipping map generation"
else
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/$SAVE_NAME.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
fi
FLAGS=(\
--port "$PORT" \
--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 \
)
if [[ $LOAD_LATEST_SAVE == true ]]; then
FLAGS+=( --start-server-load-latest )
else
FLAGS+=( --start-server "$SAVE_NAME" )
fi
# shellcheck disable=SC2086
exec $SU_EXEC /opt/factorio/bin/x64/factorio "${FLAGS[@]}" "$@"

View File

@ -0,0 +1,28 @@
#!/bin/bash
set -eou pipefail
if [[ -f /run/secrets/username ]]; then
USERNAME=$(cat /run/secrets/username)
fi
if [[ -f /run/secrets/token ]]; then
TOKEN=$(cat /run/secrets/token)
fi
if [[ -z ${USERNAME:-} ]]; then
USERNAME="$(jq -j ".username" "$CONFIG/server-settings.json")"
fi
if [[ -z ${TOKEN:-} ]]; then
TOKEN="$(jq -j ".token" "$CONFIG/server-settings.json")"
fi
if [[ -z ${USERNAME:-} ]]; then
echo "You need to provide your Factorio username to update mods."
fi
if [[ -z ${TOKEN:-} ]]; then
echo "You need to provide your Factorio token to update mods."
fi
./update-mods.sh "$VERSION" "$MODS" "$USERNAME" "$TOKEN"

44
0.18/files/scenario.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
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" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-whitelist "$CONFIG/server-whitelist.json" \
--use-server-whitelist \
--server-adminlist "$CONFIG/server-adminlist.json" \
--rcon-port "$RCON_PORT" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json

27
0.18/files/scenario2map.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
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"

96
0.18/files/update-mods.sh Executable file
View File

@ -0,0 +1,96 @@
#!/bin/bash
set -eou pipefail
FACTORIO_VERSION=$1
MOD_DIR=$2
USERNAME=$3
TOKEN=$4
MOD_BASE_URL="https://mods.factorio.com"
print_step()
{
echo "$1"
}
print_success()
{
echo "$1"
}
print_failure()
{
echo "$1"
}
update_mod()
{
MOD_NAME="$1"
MOD_NAME_ENCODED="${1// /%20}"
print_step "Checking for update of mod $MOD_NAME..."
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
print_success " Custom mod not on $MOD_BASE_URL, skipped."
return 0
fi
MOD_INFO=$(echo "$MOD_INFO_JSON" | jq -j --arg version "$FACTORIO_VERSION" ".releases|reverse|map(select(.info_json.factorio_version as \$mod_version | \$version | startswith(\$mod_version)))[0]|.file_name, \";\", .download_url, \";\", .sha1")
MOD_FILENAME=$(echo "$MOD_INFO" | cut -f1 -d";")
MOD_URL=$(echo "$MOD_INFO" | cut -f2 -d";")
MOD_SHA1=$(echo "$MOD_INFO" | cut -f3 -d";")
if [[ $MOD_FILENAME == null ]]; then
print_failure " Not compatible with version"
return 0
fi
if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Already up-to-date."
return 0
fi
print_step "Downloading..."
FULL_URL="$MOD_BASE_URL$MOD_URL?username=$USERNAME&token=$TOKEN"
HTTP_STATUS=$(curl --silent -L -w "%{http_code}" -o "$MOD_DIR/$MOD_FILENAME" "$FULL_URL")
if [[ $HTTP_STATUS != 200 ]]; then
print_failure " Download failed: Code $HTTP_STATUS."
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
if [[ ! -f $MOD_DIR/$MOD_FILENAME ]]; then
print_failure " Downloaded file missing!"
return 1
fi
if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then
print_failure " SHA1 mismatch!"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
print_success " Download complete."
for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761
if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Deleting old version: $file"
rm -f "$file"
fi
done
return 0
}
if [[ -f $MOD_DIR/mod-list.json ]]; then
jq -r ".mods|map(select(.enabled))|.[].name" "$MOD_DIR/mod-list.json" | while read -r mod; do
if [[ $mod != base ]]; then
update_mod "$mod"
fi
done
fi

45
1.0/Dockerfile Normal file
View File

@ -0,0 +1,45 @@
FROM frolvlad/alpine-glibc:alpine-3.12
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=1.0.0 \
SHA1=a50dd6f1ab17acde5a8d77bc5fb478c798d9c20e \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
SCRIPTOUTPUT=/factorio/script-output \
PUID="$PUID" \
PGID="$PGID"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -ox pipefail \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \
&& apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \
&& curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" \
&& echo "$SHA1 $archive" | sha1sum -c \
|| (sha1sum "$archive" && file "$archive" && exit 1) \
&& tar xf "$archive" --directory /opt \
&& chmod ugo=rwx /opt/factorio \
&& rm "$archive" \
&& ln -s "$SCENARIOS" /opt/factorio/scenarios \
&& ln -s "$SAVES" /opt/factorio/saves \
&& mkdir -p /opt/factorio/config/ \
&& addgroup -g "$PGID" -S "$GROUP" \
&& adduser -u "$PUID" -G "$GROUP" -s /bin/sh -SDH "$USER" \
&& chown -R "$USER":"$GROUP" /opt/factorio /factorio
COPY files/*.sh /
COPY files/config.ini /opt/factorio/config/config.ini
VOLUME /factorio
EXPOSE $PORT/udp $RCON_PORT/tcp
ENTRYPOINT ["/docker-entrypoint.sh"]

16
1.0/docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
version: '2'
services:
factorio:
build: .
ports:
- "34197:34197/udp"
- "27015:27015/tcp"
volumes:
- /opt/factorio:/factorio
# environment:
# - PUID=1000
# - PGID=1000
# - UPDATE_MODS_ON_START=true
# - USERNAME=FactorioUsername
# - TOKEN=FactorioToken
# - PORT=34198

755
1.0/files/config.ini Normal file
View File

@ -0,0 +1,755 @@
; version=8
; This is INI file : https://en.wikipedia.org/wiki/INI_file#Format
; Semicolons (;) at the beginning of the line indicate a comment. Comment lines are ignored.
[path]
read-data=__PATH__executable__/../../data
write-data=__PATH__executable__/../..
[general]
locale=
[other]
; Options: true, false
; verbose-logging=false
; Options: true, false
; log-saving-statistics=false
; autosave-interval=5
; autosave-slots=3
; In ticks
; minimum-latency-in-multiplayer=0
; In seconds
; multiplayer-initial-connection-timeout=10
; port=34197
; max-map-preview-chunk-side=64
; max-map-preview-threads=7
; In bytes
; max-multiplayer-script-reload-size=1048576
; Options: true, false
; enable-steam-networking=true
; proxy=
; proxy-username=
; proxy-password=
; Options: true, false
; check-updates=true
; Options: true, false
; enable-experimental-updates=false
; Options: true, false
; enable-new-mods=true
; Options: true, false
; use-mod-settings-per-save=true
; Options: true, false
; disable-minimal-mode=false
; Options: true, false
; disable-blueprint-storage=false
; Disables tracking which mod created/changed what prototype. Mainly for faster startup during development.
;
; Options: true, false
; disable-prototype-history=false
; Print a warning for all prototype values that were not accessed.
;
; Options: true, false
; check-unused-prototype-data=false
; Cache data stage prototype data for faster startup. Experimental.
;
; Options: true, false
; cache-prototype-data=false
; Options: true, false
; enable-razer-chroma-support=true
; Options: true, false
; enable-logitech-led-support=true
; Options: true, false
; enable-crash-log-uploading=true
; Options: true, false
; enable-heap-validation=true
; Options: true, false
; enable-threaded-message-pump=true
; Options: true, false
; enable-taskbar-animation=true
; Does nothing on Windows
;
; Options: true, false
; non-blocking-saving=false
; Related to MacOS
;
; Options: true, false
; discard-mouse-events-when-accessibility-zoomed=false
; Options: true, false
; enable-blueprint-storage-cloud-sync=false
; Options: true, false
; force-enable-factorio-version-check=false
; Options: true, false
; bring-window-to-top-on-click=true
; Options: fast, maximum
; multiplayer-compression-level=fast
; Options: none, fast, maximum
; autosave-compression-level=fast
; Socket to host RCON on when lauching MP server from the menu.
; local-rcon-socket=0.0.0.0:0
; Password for RCON when launching MP server from the menu.
; local-rcon-password=
[interface]
; Options: true, false
; automatic-ui-scale=true
; custom-ui-scale=1.000000
; tooltip-delay=0.040000
; entity-tooltip-delay=0.000000
; tooltip-offset=20
; output-console-delay=1200
; train-stop-label-angle=0.085526
; active-quick-bars=2
; shortcut-bar-rows=2
; Options: true, false
; autosort-inventory=true
; Options: true, false
; research-finished-stops-game=false
; Options: true, false
; use-item-groups=true
; Options: true, false
; use-item-subgroups=true
; Options: true, false
; use-version-filter-in-browse-games-gui=true
; Options: true, false
; use-version-filter-in-install-mods-gui=true
; Options: true, false
; play-sound-for-chat-messages=true
; Options: true, false
; fuzzy-search-enabled=false
; Options: true, false
; pick-ghost-cursor=false
; Options: true, false
; show-minimap=true
; Options: true, false
; show-tips-and-tricks=true
; Options: true, false
; show-tutorial-notifications=true
; Options: true, false
; show-turret-radius-when-blueprinting=false
; Options: true, false
; show-item-labels-in-cursor=true
; Options: true, false
; show-rail-block-visualization=true
; Options: true, false
; show-missing-logistic-network-icon=true
; Options: true, false
; show-interaction-indications=true
; Options: true, false
; show-grid-when-paused=true
; Options: true, false
; show-inserter-arrows-when-selected=true
; Options: true, false
; show-inserter-arrows-when-detailed-info-is-on=false
; Options: true, false
; show-pump-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-mining-drill-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-combinator-settings-when-detailed-info-is-on=false
; Options: true, false
; entity-tooltip-on-the-side=true
; Options: true, false
; show-mod-owners-in-tooltips=true
; Options: true, false
; show-descriptions-in-tooltips=true
; Options: true, false
; show-total-raw-in-recipe-tooltips=true
; debug-font-size=18
; train-visualization-length=5
[sound]
; master-volume=0.800000
; music-volume=0.500000
; game-effects-volume=0.700000
; gui-effects-volume=0.600000
; walking-sound-volume=0.250000
; environment-sounds-volume=0.550000
; alerts-volume=0.500000
; wind-volume=0.350000
; audible-distance=40.000000
; environment-audible-distance=30.000000
; maximum-environment-sounds=50
; active-gui-volume-modifier=0.800000
; active-gui-environment-volume-modifier=0.400000
; The maximum volume allowed for any sound.
; maximum-volume=2.000000
; ambient-music-pause-mean-seconds=45.000000
; ambient-music-pause-variance-seconds=30.000000
; Options: main-tracks-only, interleave-main-tracks-with-interludes, randomize-all
; ambient-music-mode=interleave-main-tracks-with-interludes
; zoom-audible-distance-coefficient=0.500000
; zoom-volume-coefficient=0.750000
[map-view]
; Options: true, false
; show-logistic-network=false
; Options: true, false
; show-electric-network=false
; Options: true, false
; show-turret-range=false
; Options: true, false
; show-pollution=true
; Options: true, false
; show-networkless-logistic-members=false
; Options: true, false
; show-train-station-names=true
; Options: true, false
; show-player-names=true
; Options: true, false
; show-non-standard-map-info=false
[debug]
; force=enemy
; Options: true, false
; capture-perf-statistics=false
; Options: always, debug, never
; show-fps=debug
; Options: always, debug, never
; show-detailed-info=debug
; Options: always, debug, never
; show-time-usage=debug
; Options: always, debug, never
; show-gpu-time-usage=debug
; Options: always, debug, never
; show-sprite-counts=never
; Options: always, debug, never
; show-lua-object-statistics=never
; Options: always, debug, never
; show-heat-buffer-info=never
; Options: always, debug, never
; show-multiplayer-waiting-icon=debug
; Options: always, debug, never
; show-multiplayer-statistics=debug
; Options: always, debug, never
; show-multiplayer-selection-rectangles=never
; Options: always, debug, never
; show-debug-info-in-tooltips=debug
; Options: always, debug, never
; hide-mod-guis=never
; Options: always, debug, never
; show-tile-grid=never
; Options: always, debug, never
; show-collision-rectangles=never
; Options: always, debug, never
; show-selection-rectangles=never
; Options: always, debug, never
; show-render-rectangles=never
; Options: always, debug, never
; show-entity-positions=never
; Options: always, debug, never
; show-entity-velocities=never
; Options: always, debug, never
; show-selected-entity-advanced-tiles=never
; Options: always, debug, never
; show-selected-input-transport-belts=never
; Options: always, debug, never
; show-paths=never
; Options: always, debug, never
; show-path-requests=never
; Options: always, debug, never
; show-next-waypoint-bb=never
; Options: always, debug, never
; show-target=never
; Options: always, debug, never
; show-unit-group-info=never
; Options: always, debug, never
; show-unit-behavior-info=never
; Options: always, debug, never
; show-pathfinder-fringe=never
; Options: always, debug, never
; show-path-cache=never
; Options: always, debug, never
; show-path-cache-paths=never
; Options: always, debug, never
; show-rail-paths=never
; Options: always, debug, never
; show-rolling-stock-count=never
; Options: always, debug, never
; show-rail-connections=never
; Options: always, debug, never
; show-rail-joints=never
; Options: always, debug, never
; show-rail-signal-states=never
; Options: always, debug, never
; show-rail-segment-collision-boxes=never
; Options: always, debug, never
; show-train-stop-point=never
; Options: always, debug, never
; show-train-braking-distance=never
; Options: always, debug, never
; show-train-signals=never
; Options: always, debug, never
; show-train-repathing=never
; Options: always, debug, never
; show-network-connected-entities=never
; Options: always, debug, never
; show-circuit-network-numbers=never
; Options: always, debug, never
; show-energy-sources-networks=never
; Options: always, debug, never
; show-active-state=never
; Options: always, debug, never
; show-wakeup-lists=never
; Options: always, debug, never
; show-transport-lines=never
; Options: always, debug, never
; show-transport-line-gaps=never
; Options: always, debug, never
; show-pollution-values=never
; Options: always, debug, never
; show-active-entities-on-chunk-counts=never
; Options: always, debug, never
; show-active-chunks=never
; Options: always, debug, never
; show-polluted-chunks=never
; Options: always, debug, never
; hide-chart-tags=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunks=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunk-values=never
; Options: always, debug, never
; show-bad-attack-chunks=never
; Options: always, debug, never
; show-tile-variations=never
; Options: always, debug, never
; show-raw-tile-transitions=never
; Options: always, debug, never
; show-fluid-box-fluid-info=never
; Options: always, debug, never
; show-environment-sound-info=never
; Options: always, debug, never
; show-environment-sound-area=never
; Options: always, debug, never
; show-selected-entity-audible-range=never
; Options: always, debug, never
; show-recently-played-sound-info=never
; Options: always, debug, never
; show-logistic-robot-targets=never
; Options: always, debug, never
; show-logistic-robots-on-map=never
; Options: always, debug, never
; show-recipe-icons-on-map=never
; Options: always, debug, never
; show-player-robots=never
; Options: always, debug, never
; show-fire-info=never
; Options: always, debug, never
; show-sticker-info=never
; Options: always, debug, never
; show-decorative-names=never
; Options: always, debug, never
; show-decorative-collision-rectangles=never
; Options: always, debug, never
; allow-increased-zoom=never
; Options: always, debug, never
; show-chunk-components=never
[multiplayer-lobby]
; name=
; description=
; Options: true, false
; visibility-public=true
; Options: true, false
; visibility-steam=true
; Options: true, false
; visibility-lan=true
; max-players=0
; Options: true, false
; ignore-player-limit-when-returning=false
; max-upload-in-kilobytes-per-second=0
; max-upload-slots=5
; password=
; tag-list=
; afk-auto-kick=0
; Options: true, false, admins-only
; allowed-commands=admins-only
; Options: true, false
; only-admins-can-pause=true
; Options: true, false
; autosave-only-on-server=true
; Options: true, false
; non-blocking-saving=true
; Options: true, false
; verify-user-identity=true
; Options: true, false
; enable-whitelist=false
[graphics]
; lights-render-quality=0.250000
; Default preferred display index should force finding primary monitor
; preferred-display-index=255
; screenshots-threads-count=8
; cache-sprite-atlas-count=1
; Options: true, false
; cache-sprite-atlas=false
; Options: true, false
; compress-sprite-atlas-cache=false
; Options: true, false
; texture-streaming=true
; streamed-atlas-physical-vram-size=0
; sprite-vertex-buffer-size=1048576
; max-texture-size=0
; max-threads=8
; 'low' and 'very-low' options are deprecated and will be migrated to 'normal'
;
; Options: high, normal, low, very-low
; graphics-quality=normal
; brightness=0
; contrast=0
; saturation=100
; Options: true, false
; full-screen=true
; Options: true, false
; minimize-on-focus-loss=false
; Options: true, false
; show-smoke=true
; Options: true, false
; show-clouds=true
; Options: true, false
; show-decoratives=true
; Options: true, false
; show-particles=true
; Options: true, false
; show-item-shadows=true
; Options: true, false
; show-inserter-shadows=true
; Options: true, false
; show-animated-water=true
; Options: true, false
; show-tree-distortion=true
; Options: true, false
; force-opengl=false
; Options: true, false
; v-sync=true
; Options: true, false
; high-quality-animations=true
; Options: true, false
; high-quality-shadows=false
; Options: true, false
; high-quality-terrain=true
; Minimum number of turrets required to turn on the turret range overdraw optimization
; turret-overdraw-minimum-count=4
; Scale at which the turret range overdraw optimization will start being applied
; turret-overdraw-scale-threshold=0.200000
; Options: true, false
; skip-vram-detection=false
; Options: true, false
; halt-rendering-when-minimized=true
; Options: true, false
; runtime-sprite-reload=false
; Options: true, false
; full-color-depth=true
; Options: true, false
; render-in-native-resolution=true
; Options: true, false
; use-flip-presentation-model=false
; Options: true, false
; debug-api=false
; Options: true, false
; discard-buffers-on-begin-frame=true
; Options: all, high, medium, low
; video-memory-usage=high
; Options: none, high-quality, low-quality
; texture-compression-level=high-quality
; Options: true, false
; compress-virtual-atlas=true
; Options: copy, copy-sequential, flip, flip-discard
; dxgi-presentation-model=copy
; Options: none, flush, wait-for-vblank, flush-and-wait-for-vblank
; dxgi-action-before-present=none
; relevant only for flip presentation models
;
; Options: true, false
; dxgi-allow-tearing=false
; Options: false, true, auto
; dxgi-flip-do-not-wait=false
; Options: true, false
; dxgi-present-restart=false
; dxgi-swap-chain-buffer-count=0
; dxgi-max-frame-latency=0
; dxgi-adapter-index=-1
; max-sprite-loading-threads=32
; Options: true, false
; gpu-accelerated-compression=true
; Options: true, false
; gpu-accelerated-mipmap-compression=true
; Options: true, false
; wait-until-mipmap-generation-finished=true
; Options: true, false
; check-for-unused-pixels=false
; ogl-depth-buffer-bit-depth=0
; Options: false, true, auto
; ogl-accelerated-renderer=auto
; Options: true, false
; ogl-double-buffered=true
; Set to true if mipmapped sprites render very blurry on your GPU. Limited support.
;
; Options: true, false
; legacy-gpu-no-mipmaps=false
; Options: true, false
; force-linear-magnification=false
; Options: true, false
; custom-mipmap-workaround=false
; Options: true, false
; buffer-rename-workaround=false
; Comma separated list of OpenGL extensions that should not be used (for example: ARB_copy_image,KHR_debug)
; disabled-opengl-extensions=

98
1.0/files/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,98 @@
#!/bin/bash
set -eoux pipefail
FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
SAVE_NAME="${SAVE_NAME:-""}"
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 [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
./docker-update-mods.sh
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
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
NRSAVES=$(find -L "$SAVES" -iname \*.zip -mindepth 1 | wc -l)
if [[ $GENERATE_NEW_SAVE != true && $NRSAVES == 0 ]]; then
GENERATE_NEW_SAVE=true
SAVE_NAME=_autosave1
fi
if [[ $GENERATE_NEW_SAVE == true ]]; then
if [[ -z "$SAVE_NAME" ]]; then
echo "If \$GENERATE_NEW_SAVE is true, you must specify \$SAVE_NAME"
exit 1
fi
if [[ -f "$SAVES/$SAVE_NAME.zip" ]]; then
echo "Map $SAVES/$SAVE_NAME.zip already exists, skipping map generation"
else
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/$SAVE_NAME.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
fi
FLAGS=(\
--port "$PORT" \
--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 \
)
if [[ $LOAD_LATEST_SAVE == true ]]; then
FLAGS+=( --start-server-load-latest )
else
FLAGS+=( --start-server "$SAVE_NAME" )
fi
# shellcheck disable=SC2086
exec $SU_EXEC /opt/factorio/bin/x64/factorio "${FLAGS[@]}" "$@"

28
1.0/files/docker-update-mods.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -eou pipefail
if [[ -f /run/secrets/username ]]; then
USERNAME=$(cat /run/secrets/username)
fi
if [[ -f /run/secrets/token ]]; then
TOKEN=$(cat /run/secrets/token)
fi
if [[ -z ${USERNAME:-} ]]; then
USERNAME="$(jq -j ".username" "$CONFIG/server-settings.json")"
fi
if [[ -z ${TOKEN:-} ]]; then
TOKEN="$(jq -j ".token" "$CONFIG/server-settings.json")"
fi
if [[ -z ${USERNAME:-} ]]; then
echo "You need to provide your Factorio username to update mods."
fi
if [[ -z ${TOKEN:-} ]]; then
echo "You need to provide your Factorio token to update mods."
fi
./update-mods.sh "$VERSION" "$MODS" "$USERNAME" "$TOKEN"

44
1.0/files/scenario.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
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" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-whitelist "$CONFIG/server-whitelist.json" \
--use-server-whitelist \
--server-adminlist "$CONFIG/server-adminlist.json" \
--rcon-port "$RCON_PORT" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json

27
1.0/files/scenario2map.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
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"

96
1.0/files/update-mods.sh Executable file
View File

@ -0,0 +1,96 @@
#!/bin/bash
set -eou pipefail
FACTORIO_VERSION=$1
MOD_DIR=$2
USERNAME=$3
TOKEN=$4
MOD_BASE_URL="https://mods.factorio.com"
print_step()
{
echo "$1"
}
print_success()
{
echo "$1"
}
print_failure()
{
echo "$1"
}
update_mod()
{
MOD_NAME="$1"
MOD_NAME_ENCODED="${1// /%20}"
print_step "Checking for update of mod $MOD_NAME..."
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
print_success " Custom mod not on $MOD_BASE_URL, skipped."
return 0
fi
MOD_INFO=$(echo "$MOD_INFO_JSON" | jq -j --arg version "$FACTORIO_VERSION" ".releases|reverse|map(select(.info_json.factorio_version as \$mod_version | \$version | startswith(\$mod_version)))[0]|.file_name, \";\", .download_url, \";\", .sha1")
MOD_FILENAME=$(echo "$MOD_INFO" | cut -f1 -d";")
MOD_URL=$(echo "$MOD_INFO" | cut -f2 -d";")
MOD_SHA1=$(echo "$MOD_INFO" | cut -f3 -d";")
if [[ $MOD_FILENAME == null ]]; then
print_failure " Not compatible with version"
return 0
fi
if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Already up-to-date."
return 0
fi
print_step "Downloading..."
FULL_URL="$MOD_BASE_URL$MOD_URL?username=$USERNAME&token=$TOKEN"
HTTP_STATUS=$(curl --silent -L -w "%{http_code}" -o "$MOD_DIR/$MOD_FILENAME" "$FULL_URL")
if [[ $HTTP_STATUS != 200 ]]; then
print_failure " Download failed: Code $HTTP_STATUS."
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
if [[ ! -f $MOD_DIR/$MOD_FILENAME ]]; then
print_failure " Downloaded file missing!"
return 1
fi
if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then
print_failure " SHA1 mismatch!"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
print_success " Download complete."
for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761
if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Deleting old version: $file"
rm -f "$file"
fi
done
return 0
}
if [[ -f $MOD_DIR/mod-list.json ]]; then
jq -r ".mods|map(select(.enabled))|.[].name" "$MOD_DIR/mod-list.json" | while read -r mod; do
if [[ $mod != base ]]; then
update_mod "$mod"
fi
done
fi

45
1.1/Dockerfile Normal file
View File

@ -0,0 +1,45 @@
FROM frolvlad/alpine-glibc:alpine-3.12
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=1.1.36 \
SHA1=7a5a735a65ce43525bd4783bd19b994b7c714d24 \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \
SCRIPTOUTPUT=/factorio/script-output \
PUID="$PUID" \
PGID="$PGID"
SHELL ["/bin/ash", "-eo", "pipefail", "-c"]
RUN set -ox pipefail \
&& archive="/tmp/factorio_headless_x64_$VERSION.tar.xz" \
&& mkdir -p /opt /factorio \
&& apk add --update --no-cache --no-progress bash binutils curl file gettext jq libintl pwgen shadow su-exec \
&& curl -sSL "https://www.factorio.com/get-download/$VERSION/headless/linux64" -o "$archive" \
&& echo "$SHA1 $archive" | sha1sum -c \
|| (sha1sum "$archive" && file "$archive" && exit 1) \
&& tar xf "$archive" --directory /opt \
&& chmod ugo=rwx /opt/factorio \
&& rm "$archive" \
&& ln -s "$SCENARIOS" /opt/factorio/scenarios \
&& ln -s "$SAVES" /opt/factorio/saves \
&& mkdir -p /opt/factorio/config/ \
&& addgroup -g "$PGID" -S "$GROUP" \
&& adduser -u "$PUID" -G "$GROUP" -s /bin/sh -SDH "$USER" \
&& chown -R "$USER":"$GROUP" /opt/factorio /factorio
COPY files/*.sh /
COPY files/config.ini /opt/factorio/config/config.ini
VOLUME /factorio
EXPOSE $PORT/udp $RCON_PORT/tcp
ENTRYPOINT ["/docker-entrypoint.sh"]

16
1.1/docker-compose.yml Normal file
View File

@ -0,0 +1,16 @@
version: '2'
services:
factorio:
build: .
ports:
- "34197:34197/udp"
- "27015:27015/tcp"
volumes:
- /opt/factorio:/factorio
# environment:
# - PUID=1000
# - PGID=1000
# - UPDATE_MODS_ON_START=true
# - USERNAME=FactorioUsername
# - TOKEN=FactorioToken
# - PORT=34198

755
1.1/files/config.ini Normal file
View File

@ -0,0 +1,755 @@
; version=8
; This is INI file : https://en.wikipedia.org/wiki/INI_file#Format
; Semicolons (;) at the beginning of the line indicate a comment. Comment lines are ignored.
[path]
read-data=__PATH__executable__/../../data
write-data=__PATH__executable__/../..
[general]
locale=
[other]
; Options: true, false
; verbose-logging=false
; Options: true, false
; log-saving-statistics=false
; autosave-interval=5
; autosave-slots=3
; In ticks
; minimum-latency-in-multiplayer=0
; In seconds
; multiplayer-initial-connection-timeout=10
; port=34197
; max-map-preview-chunk-side=64
; max-map-preview-threads=7
; In bytes
; max-multiplayer-script-reload-size=1048576
; Options: true, false
; enable-steam-networking=true
; proxy=
; proxy-username=
; proxy-password=
; Options: true, false
; check-updates=true
; Options: true, false
; enable-experimental-updates=false
; Options: true, false
; enable-new-mods=true
; Options: true, false
; use-mod-settings-per-save=true
; Options: true, false
; disable-minimal-mode=false
; Options: true, false
; disable-blueprint-storage=false
; Disables tracking which mod created/changed what prototype. Mainly for faster startup during development.
;
; Options: true, false
; disable-prototype-history=false
; Print a warning for all prototype values that were not accessed.
;
; Options: true, false
; check-unused-prototype-data=false
; Cache data stage prototype data for faster startup. Experimental.
;
; Options: true, false
; cache-prototype-data=false
; Options: true, false
; enable-razer-chroma-support=true
; Options: true, false
; enable-logitech-led-support=true
; Options: true, false
; enable-crash-log-uploading=true
; Options: true, false
; enable-heap-validation=true
; Options: true, false
; enable-threaded-message-pump=true
; Options: true, false
; enable-taskbar-animation=true
; Does nothing on Windows
;
; Options: true, false
; non-blocking-saving=false
; Related to MacOS
;
; Options: true, false
; discard-mouse-events-when-accessibility-zoomed=false
; Options: true, false
; enable-blueprint-storage-cloud-sync=false
; Options: true, false
; force-enable-factorio-version-check=false
; Options: true, false
; bring-window-to-top-on-click=true
; Options: fast, maximum
; multiplayer-compression-level=fast
; Options: none, fast, maximum
; autosave-compression-level=fast
; Socket to host RCON on when lauching MP server from the menu.
; local-rcon-socket=0.0.0.0:0
; Password for RCON when launching MP server from the menu.
; local-rcon-password=
[interface]
; Options: true, false
; automatic-ui-scale=true
; custom-ui-scale=1.000000
; tooltip-delay=0.040000
; entity-tooltip-delay=0.000000
; tooltip-offset=20
; output-console-delay=1200
; train-stop-label-angle=0.085526
; active-quick-bars=2
; shortcut-bar-rows=2
; Options: true, false
; autosort-inventory=true
; Options: true, false
; research-finished-stops-game=false
; Options: true, false
; use-item-groups=true
; Options: true, false
; use-item-subgroups=true
; Options: true, false
; use-version-filter-in-browse-games-gui=true
; Options: true, false
; use-version-filter-in-install-mods-gui=true
; Options: true, false
; play-sound-for-chat-messages=true
; Options: true, false
; fuzzy-search-enabled=false
; Options: true, false
; pick-ghost-cursor=false
; Options: true, false
; show-minimap=true
; Options: true, false
; show-tips-and-tricks=true
; Options: true, false
; show-tutorial-notifications=true
; Options: true, false
; show-turret-radius-when-blueprinting=false
; Options: true, false
; show-item-labels-in-cursor=true
; Options: true, false
; show-rail-block-visualization=true
; Options: true, false
; show-missing-logistic-network-icon=true
; Options: true, false
; show-interaction-indications=true
; Options: true, false
; show-grid-when-paused=true
; Options: true, false
; show-inserter-arrows-when-selected=true
; Options: true, false
; show-inserter-arrows-when-detailed-info-is-on=false
; Options: true, false
; show-pump-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-mining-drill-arrows-when-detailed-info-is-on=true
; Options: true, false
; show-combinator-settings-when-detailed-info-is-on=false
; Options: true, false
; entity-tooltip-on-the-side=true
; Options: true, false
; show-mod-owners-in-tooltips=true
; Options: true, false
; show-descriptions-in-tooltips=true
; Options: true, false
; show-total-raw-in-recipe-tooltips=true
; debug-font-size=18
; train-visualization-length=5
[sound]
; master-volume=0.800000
; music-volume=0.500000
; game-effects-volume=0.700000
; gui-effects-volume=0.600000
; walking-sound-volume=0.250000
; environment-sounds-volume=0.550000
; alerts-volume=0.500000
; wind-volume=0.350000
; audible-distance=40.000000
; environment-audible-distance=30.000000
; maximum-environment-sounds=50
; active-gui-volume-modifier=0.800000
; active-gui-environment-volume-modifier=0.400000
; The maximum volume allowed for any sound.
; maximum-volume=2.000000
; ambient-music-pause-mean-seconds=45.000000
; ambient-music-pause-variance-seconds=30.000000
; Options: main-tracks-only, interleave-main-tracks-with-interludes, randomize-all
; ambient-music-mode=interleave-main-tracks-with-interludes
; zoom-audible-distance-coefficient=0.500000
; zoom-volume-coefficient=0.750000
[map-view]
; Options: true, false
; show-logistic-network=false
; Options: true, false
; show-electric-network=false
; Options: true, false
; show-turret-range=false
; Options: true, false
; show-pollution=true
; Options: true, false
; show-networkless-logistic-members=false
; Options: true, false
; show-train-station-names=true
; Options: true, false
; show-player-names=true
; Options: true, false
; show-non-standard-map-info=false
[debug]
; force=enemy
; Options: true, false
; capture-perf-statistics=false
; Options: always, debug, never
; show-fps=debug
; Options: always, debug, never
; show-detailed-info=debug
; Options: always, debug, never
; show-time-usage=debug
; Options: always, debug, never
; show-gpu-time-usage=debug
; Options: always, debug, never
; show-sprite-counts=never
; Options: always, debug, never
; show-lua-object-statistics=never
; Options: always, debug, never
; show-heat-buffer-info=never
; Options: always, debug, never
; show-multiplayer-waiting-icon=debug
; Options: always, debug, never
; show-multiplayer-statistics=debug
; Options: always, debug, never
; show-multiplayer-selection-rectangles=never
; Options: always, debug, never
; show-debug-info-in-tooltips=debug
; Options: always, debug, never
; hide-mod-guis=never
; Options: always, debug, never
; show-tile-grid=never
; Options: always, debug, never
; show-collision-rectangles=never
; Options: always, debug, never
; show-selection-rectangles=never
; Options: always, debug, never
; show-render-rectangles=never
; Options: always, debug, never
; show-entity-positions=never
; Options: always, debug, never
; show-entity-velocities=never
; Options: always, debug, never
; show-selected-entity-advanced-tiles=never
; Options: always, debug, never
; show-selected-input-transport-belts=never
; Options: always, debug, never
; show-paths=never
; Options: always, debug, never
; show-path-requests=never
; Options: always, debug, never
; show-next-waypoint-bb=never
; Options: always, debug, never
; show-target=never
; Options: always, debug, never
; show-unit-group-info=never
; Options: always, debug, never
; show-unit-behavior-info=never
; Options: always, debug, never
; show-pathfinder-fringe=never
; Options: always, debug, never
; show-path-cache=never
; Options: always, debug, never
; show-path-cache-paths=never
; Options: always, debug, never
; show-rail-paths=never
; Options: always, debug, never
; show-rolling-stock-count=never
; Options: always, debug, never
; show-rail-connections=never
; Options: always, debug, never
; show-rail-joints=never
; Options: always, debug, never
; show-rail-signal-states=never
; Options: always, debug, never
; show-rail-segment-collision-boxes=never
; Options: always, debug, never
; show-train-stop-point=never
; Options: always, debug, never
; show-train-braking-distance=never
; Options: always, debug, never
; show-train-signals=never
; Options: always, debug, never
; show-train-repathing=never
; Options: always, debug, never
; show-network-connected-entities=never
; Options: always, debug, never
; show-circuit-network-numbers=never
; Options: always, debug, never
; show-energy-sources-networks=never
; Options: always, debug, never
; show-active-state=never
; Options: always, debug, never
; show-wakeup-lists=never
; Options: always, debug, never
; show-transport-lines=never
; Options: always, debug, never
; show-transport-line-gaps=never
; Options: always, debug, never
; show-pollution-values=never
; Options: always, debug, never
; show-active-entities-on-chunk-counts=never
; Options: always, debug, never
; show-active-chunks=never
; Options: always, debug, never
; show-polluted-chunks=never
; Options: always, debug, never
; hide-chart-tags=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunks=never
; Options: always, debug, never
; show-enemy-expansion-candidate-chunk-values=never
; Options: always, debug, never
; show-bad-attack-chunks=never
; Options: always, debug, never
; show-tile-variations=never
; Options: always, debug, never
; show-raw-tile-transitions=never
; Options: always, debug, never
; show-fluid-box-fluid-info=never
; Options: always, debug, never
; show-environment-sound-info=never
; Options: always, debug, never
; show-environment-sound-area=never
; Options: always, debug, never
; show-selected-entity-audible-range=never
; Options: always, debug, never
; show-recently-played-sound-info=never
; Options: always, debug, never
; show-logistic-robot-targets=never
; Options: always, debug, never
; show-logistic-robots-on-map=never
; Options: always, debug, never
; show-recipe-icons-on-map=never
; Options: always, debug, never
; show-player-robots=never
; Options: always, debug, never
; show-fire-info=never
; Options: always, debug, never
; show-sticker-info=never
; Options: always, debug, never
; show-decorative-names=never
; Options: always, debug, never
; show-decorative-collision-rectangles=never
; Options: always, debug, never
; allow-increased-zoom=never
; Options: always, debug, never
; show-chunk-components=never
[multiplayer-lobby]
; name=
; description=
; Options: true, false
; visibility-public=true
; Options: true, false
; visibility-steam=true
; Options: true, false
; visibility-lan=true
; max-players=0
; Options: true, false
; ignore-player-limit-when-returning=false
; max-upload-in-kilobytes-per-second=0
; max-upload-slots=5
; password=
; tag-list=
; afk-auto-kick=0
; Options: true, false, admins-only
; allowed-commands=admins-only
; Options: true, false
; only-admins-can-pause=true
; Options: true, false
; autosave-only-on-server=true
; Options: true, false
; non-blocking-saving=true
; Options: true, false
; verify-user-identity=true
; Options: true, false
; enable-whitelist=false
[graphics]
; lights-render-quality=0.250000
; Default preferred display index should force finding primary monitor
; preferred-display-index=255
; screenshots-threads-count=8
; cache-sprite-atlas-count=1
; Options: true, false
; cache-sprite-atlas=false
; Options: true, false
; compress-sprite-atlas-cache=false
; Options: true, false
; texture-streaming=true
; streamed-atlas-physical-vram-size=0
; sprite-vertex-buffer-size=1048576
; max-texture-size=0
; max-threads=8
; 'low' and 'very-low' options are deprecated and will be migrated to 'normal'
;
; Options: high, normal, low, very-low
; graphics-quality=normal
; brightness=0
; contrast=0
; saturation=100
; Options: true, false
; full-screen=true
; Options: true, false
; minimize-on-focus-loss=false
; Options: true, false
; show-smoke=true
; Options: true, false
; show-clouds=true
; Options: true, false
; show-decoratives=true
; Options: true, false
; show-particles=true
; Options: true, false
; show-item-shadows=true
; Options: true, false
; show-inserter-shadows=true
; Options: true, false
; show-animated-water=true
; Options: true, false
; show-tree-distortion=true
; Options: true, false
; force-opengl=false
; Options: true, false
; v-sync=true
; Options: true, false
; high-quality-animations=true
; Options: true, false
; high-quality-shadows=false
; Options: true, false
; high-quality-terrain=true
; Minimum number of turrets required to turn on the turret range overdraw optimization
; turret-overdraw-minimum-count=4
; Scale at which the turret range overdraw optimization will start being applied
; turret-overdraw-scale-threshold=0.200000
; Options: true, false
; skip-vram-detection=false
; Options: true, false
; halt-rendering-when-minimized=true
; Options: true, false
; runtime-sprite-reload=false
; Options: true, false
; full-color-depth=true
; Options: true, false
; render-in-native-resolution=true
; Options: true, false
; use-flip-presentation-model=false
; Options: true, false
; debug-api=false
; Options: true, false
; discard-buffers-on-begin-frame=true
; Options: all, high, medium, low
; video-memory-usage=high
; Options: none, high-quality, low-quality
; texture-compression-level=high-quality
; Options: true, false
; compress-virtual-atlas=true
; Options: copy, copy-sequential, flip, flip-discard
; dxgi-presentation-model=copy
; Options: none, flush, wait-for-vblank, flush-and-wait-for-vblank
; dxgi-action-before-present=none
; relevant only for flip presentation models
;
; Options: true, false
; dxgi-allow-tearing=false
; Options: false, true, auto
; dxgi-flip-do-not-wait=false
; Options: true, false
; dxgi-present-restart=false
; dxgi-swap-chain-buffer-count=0
; dxgi-max-frame-latency=0
; dxgi-adapter-index=-1
; max-sprite-loading-threads=32
; Options: true, false
; gpu-accelerated-compression=true
; Options: true, false
; gpu-accelerated-mipmap-compression=true
; Options: true, false
; wait-until-mipmap-generation-finished=true
; Options: true, false
; check-for-unused-pixels=false
; ogl-depth-buffer-bit-depth=0
; Options: false, true, auto
; ogl-accelerated-renderer=auto
; Options: true, false
; ogl-double-buffered=true
; Set to true if mipmapped sprites render very blurry on your GPU. Limited support.
;
; Options: true, false
; legacy-gpu-no-mipmaps=false
; Options: true, false
; force-linear-magnification=false
; Options: true, false
; custom-mipmap-workaround=false
; Options: true, false
; buffer-rename-workaround=false
; Comma separated list of OpenGL extensions that should not be used (for example: ARB_copy_image,KHR_debug)
; disabled-opengl-extensions=

98
1.1/files/docker-entrypoint.sh Executable file
View File

@ -0,0 +1,98 @@
#!/bin/bash
set -eoux pipefail
FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
SAVE_NAME="${SAVE_NAME:-""}"
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 [[ ${UPDATE_MODS_ON_START:-} == "true" ]]; then
./docker-update-mods.sh
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
sed -i '/write-data=/c\write-data=\/factorio/' /opt/factorio/config/config.ini
NRSAVES=$(find -L "$SAVES" -iname \*.zip -mindepth 1 | wc -l)
if [[ $GENERATE_NEW_SAVE != true && $NRSAVES == 0 ]]; then
GENERATE_NEW_SAVE=true
SAVE_NAME=_autosave1
fi
if [[ $GENERATE_NEW_SAVE == true ]]; then
if [[ -z "$SAVE_NAME" ]]; then
echo "If \$GENERATE_NEW_SAVE is true, you must specify \$SAVE_NAME"
exit 1
fi
if [[ -f "$SAVES/$SAVE_NAME.zip" ]]; then
echo "Map $SAVES/$SAVE_NAME.zip already exists, skipping map generation"
else
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/$SAVE_NAME.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
fi
FLAGS=(\
--port "$PORT" \
--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 \
)
if [[ $LOAD_LATEST_SAVE == true ]]; then
FLAGS+=( --start-server-load-latest )
else
FLAGS+=( --start-server "$SAVE_NAME" )
fi
# shellcheck disable=SC2086
exec $SU_EXEC /opt/factorio/bin/x64/factorio "${FLAGS[@]}" "$@"

28
1.1/files/docker-update-mods.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash
set -eou pipefail
if [[ -f /run/secrets/username ]]; then
USERNAME=$(cat /run/secrets/username)
fi
if [[ -f /run/secrets/token ]]; then
TOKEN=$(cat /run/secrets/token)
fi
if [[ -z ${USERNAME:-} ]]; then
USERNAME="$(jq -j ".username" "$CONFIG/server-settings.json")"
fi
if [[ -z ${TOKEN:-} ]]; then
TOKEN="$(jq -j ".token" "$CONFIG/server-settings.json")"
fi
if [[ -z ${USERNAME:-} ]]; then
echo "You need to provide your Factorio username to update mods."
fi
if [[ -z ${TOKEN:-} ]]; then
echo "You need to provide your Factorio token to update mods."
fi
./update-mods.sh "$VERSION" "$MODS" "$USERNAME" "$TOKEN"

44
1.1/files/scenario.sh Executable file
View File

@ -0,0 +1,44 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
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" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json" \
--server-settings "$CONFIG/server-settings.json" \
--server-banlist "$CONFIG/server-banlist.json" \
--server-whitelist "$CONFIG/server-whitelist.json" \
--use-server-whitelist \
--server-adminlist "$CONFIG/server-adminlist.json" \
--rcon-port "$RCON_PORT" \
--rcon-password "$(cat "$CONFIG/rconpw")" \
--server-id /factorio/config/server-id.json

27
1.1/files/scenario2map.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]]; then
echo "No argument supplied"
fi
SERVER_SCENARIO="$1"
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"

96
1.1/files/update-mods.sh Executable file
View File

@ -0,0 +1,96 @@
#!/bin/bash
set -eou pipefail
FACTORIO_VERSION=$1
MOD_DIR=$2
USERNAME=$3
TOKEN=$4
MOD_BASE_URL="https://mods.factorio.com"
print_step()
{
echo "$1"
}
print_success()
{
echo "$1"
}
print_failure()
{
echo "$1"
}
update_mod()
{
MOD_NAME="$1"
MOD_NAME_ENCODED="${1// /%20}"
print_step "Checking for update of mod $MOD_NAME..."
MOD_INFO_URL="$MOD_BASE_URL/api/mods/$MOD_NAME_ENCODED"
MOD_INFO_JSON=$(curl --silent "$MOD_INFO_URL")
if ! echo "$MOD_INFO_JSON" | jq -e .name >/dev/null; then
print_success " Custom mod not on $MOD_BASE_URL, skipped."
return 0
fi
MOD_INFO=$(echo "$MOD_INFO_JSON" | jq -j --arg version "$FACTORIO_VERSION" ".releases|reverse|map(select(.info_json.factorio_version as \$mod_version | \$version | startswith(\$mod_version)))[0]|.file_name, \";\", .download_url, \";\", .sha1")
MOD_FILENAME=$(echo "$MOD_INFO" | cut -f1 -d";")
MOD_URL=$(echo "$MOD_INFO" | cut -f2 -d";")
MOD_SHA1=$(echo "$MOD_INFO" | cut -f3 -d";")
if [[ $MOD_FILENAME == null ]]; then
print_failure " Not compatible with version"
return 0
fi
if [[ -f $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Already up-to-date."
return 0
fi
print_step "Downloading..."
FULL_URL="$MOD_BASE_URL$MOD_URL?username=$USERNAME&token=$TOKEN"
HTTP_STATUS=$(curl --silent -L -w "%{http_code}" -o "$MOD_DIR/$MOD_FILENAME" "$FULL_URL")
if [[ $HTTP_STATUS != 200 ]]; then
print_failure " Download failed: Code $HTTP_STATUS."
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
if [[ ! -f $MOD_DIR/$MOD_FILENAME ]]; then
print_failure " Downloaded file missing!"
return 1
fi
if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then
print_failure " SHA1 mismatch!"
rm -f "$MOD_DIR/$MOD_FILENAME"
return 1
fi
print_success " Download complete."
for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761
if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Deleting old version: $file"
rm -f "$file"
fi
done
return 0
}
if [[ -f $MOD_DIR/mod-list.json ]]; then
jq -r ".mods|map(select(.enabled))|.[].name" "$MOD_DIR/mod-list.json" | while read -r mod; do
if [[ $mod != base ]]; then
update_mod "$mod"
fi
done
fi

250
README.md
View File

@ -1,11 +1,16 @@
# Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) [![Docker Version](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://hub.docker.com/r/factoriotools/factorio/) [![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/) [![Microbadger Layers](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com")
# Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) ![Updater status](https://img.shields.io/endpoint?label=Updater%20status&logo=a&url=https%3A%2F%2Fhealthchecks.supersandro.de%2Fbadge%2F1a0a7698-445d-4e54-9e4b-f61a1544e01f%2FBO8VukOA%2Fmaintainer.shields) [![Docker Version](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://hub.docker.com/r/factoriotools/factorio/) [![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/) [![Microbadger Layers](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com")
* `0.17.68`, `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)
[中文](./README_zh_CN.md)
* `1.1.35`, `1.1`, `latest`, `stable` [(1.1/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/1.1/Dockerfile)
* `1.0.0`, `1.0` [(1.0/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/1.0/Dockerfile)
* `0.18.47`, `0.18` [(0.18/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.18/Dockerfile)
* `0.17.79`, `0.17` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile)
* `0.16.51`, `0.16` [(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*
## Tag descriptions
* `latest` - most up-to-date version (may be experimental).
* `stable` - version declared stable on [factorio.com](https://www.factorio.com).
@ -13,8 +18,7 @@
* `0.x.y` - a specific version.
* `0.x-z` - incremental fix for that version.
# What is Factorio?
## What is Factorio?
[Factorio](https://www.factorio.com) is a game in which you build and maintain factories.
@ -22,16 +26,15 @@ You will be mining resources, researching technologies, building infrastructure,
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 at [factorio.com](https://www.factorio.com) and [Steam](http://store.steampowered.com/app/427520/).
NOTE: This is only the server. The full game is available at [Factorio.com](https://www.factorio.com), [Steam](https://store.steampowered.com/app/427520/), [GOG.com](https://www.gog.com/game/factorio) and [Humble Bundle](https://www.humblebundle.com/store/factorio).
## Usage
# Usage
## Quick Start
### Quick Start
Run the server to create the necessary folder structure and configuration files. For this example data is stored in `/opt/factorio`.
```
```shell
sudo mkdir -p /opt/factorio
sudo chown 845:845 /opt/factorio
sudo docker run -d \
@ -55,36 +58,36 @@ The `chown` command is needed because in 0.16+, we no longer run the game server
Check the logs to see what happened:
```
```shell
docker logs factorio
```
Stop the server:
```
```shell
docker stop factorio
```
Now there's a `server-settings.json` file in the folder `/opt/factorio/config`. Modify this to your liking and restart the server:
```
```shell
docker start factorio
```
Try to connect to the server. Check the logs if it isn't working.
## Console
### Console
To issue console commands to the server, start the server in interactive mode with `-it`. Open the console with `docker attach` and then type commands.
docker run -d -it \
--name factorio \
factoriotools/factorio
docker attach factorio
```shell
docker run -d -it \
--name factorio \
factoriotools/factorio
docker attach factorio
```
## Upgrading
### Upgrading
Before upgrading backup the save. It's easy to make a save in the client.
@ -92,14 +95,15 @@ Ensure `-v` was used to run the server so the save is outside of the Docker cont
Delete the container and refresh the image:
docker stop factorio
docker rm factorio
docker pull factoriotools/factorio
```shell
docker stop factorio
docker rm 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!
## Saves
### Saves
A new map named `_autosave1.zip` is generated the first time the server is started. The `map-gen-settings.json` and `map-settings.json` files in `/opt/factorio/config` are used for the map settings. On subsequent runs the newest save is used.
@ -107,19 +111,50 @@ To load an old save stop the server and run the command `touch oldsave.zip`. Thi
To generate a new map stop the server, delete all of the saves and restart the server.
#### Specify a save directly (0.17.79-2+)
## Mods
You can specify a specific save to load by configuring the server through a set of environment variables:
To load an existing save set `SAVE_NAME` to the name of your existing save file located within the `saves` directory, without the `.zip` extension:
```shell
sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
-e LOAD_LATEST_SAVE=false \
-e SAVE_NAME=replaceme \
--name factorio \
--restart=always \
factoriotools/factorio
```
To generate a new map set `GENERATE_NEW_SAVE=true` and specify `SAVE_NAME`:
```shell
sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
-e LOAD_LATEST_SAVE=false \
-e GENERATE_NEW_SAVE=true \
-e SAVE_NAME=replaceme \
--name factorio \
--restart=always \
factoriotools/factorio
```
### Mods
Copy mods into the mods folder and restart the server.
As of 0.17 a new environment variable was added ``UPDATE_MODS_ON_START`` which if set to ``true`` will cause the mods get to updated on server start. If set a valid [Factorio Username and Token](https://www.factorio.com/profile) must be supplied or else the server will not start. They can either be set as docker secrets, environment variables, or pulled from the server-settings.json file.
## Scenarios
### 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.
```
```shell
docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
@ -131,11 +166,11 @@ docker run -d \
MyScenarioName
```
## Converting Scenarios to Regular Maps
### 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.
```
```shell
docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
@ -147,7 +182,7 @@ docker run -d \
MyScenarioName
```
## RCON
### RCON
Set the RCON password in the `rconpw` file. A random password is generated if `rconpw` doesn't exist.
@ -155,60 +190,67 @@ To change the password, stop the server, modify `rconpw`, and restart the server
To "disable" RCON don't expose port 27015, i.e. start the server without `-p 27015:27015/tcp`. RCON is still running, but nobody can to connect to it.
## Whitelisting (0.15.3+)
### Whitelisting (0.15.3+)
Create file `config/server-whitelist.json` and add the whitelisted users.
[
"you",
"friend"
]
```json
[
"you",
"friend"
]
```
## Banlisting (0.17.1+)
### Banlisting (0.17.1+)
Create file `config/server-banlist.json` and add the banlisted users.
[
"bad_person",
"other_bad_person"
]
```json
[
"bad_person",
"other_bad_person"
]
```
## Adminlisting (0.17.1+)
### Adminlisting (0.17.1+)
Create file `config/server-adminlist.json` and add the adminlisted users.
[
"you",
"friend"
]
```json
[
"you",
"friend"
]
```
## Customize configuration files (0.17.x+)
### 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"
```yaml
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}",
```json
"name": "${INSTANCE_NAME}",
"description": "${INSTANCE_DESC}",
```
# Container Details
## Container Details
The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
@ -216,26 +258,27 @@ The philosophy is to [keep it simple](http://wiki.c2.com/?KeepItSimple).
* Prefer configuration files over environment variables.
* Use one volume for data.
## Volumes
### Volumes
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
| `-- fancymod.zip
`-- saves
`-- _autosave1.zip
```text
factorio
|-- config
| |-- map-gen-settings.json
| |-- map-settings.json
| |-- rconpw
| |-- server-adminlist.json
| |-- server-banlist.json
| |-- server-settings.json
| `-- server-whitelist.json
|-- mods
| `-- fancymod.zip
`-- saves
`-- _autosave1.zip
```
## Docker Compose
@ -243,14 +286,14 @@ The files in this volume should be owned by the factorio user, uid 845.
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:
```
```shell
git clone https://github.com/factoriotools/factorio-docker.git
cd docker_factorio_server/0.17
```
Or make your own:
```
```shell
version: '2'
services:
factorio:
@ -264,30 +307,22 @@ services:
Now cd to the directory with docker-compose.yml and run:
```
```shell
sudo mkdir -p /opt/factorio
sudo chown 845:845 /opt/factorio
sudo docker-compose up -d
```
### Ports
## Ports
* `34197/udp` - Game server (required).
* `34197/udp` - Game server (required). This can be changed with the `PORT` environment variable.
* `27015/tcp` - RCON (optional).
## Environment Variables
* `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
Ensure the `lan` setting in server-settings.json is `true`.
```
```shell
"visibility":
{
"public": false,
@ -297,7 +332,7 @@ Ensure the `lan` setting in server-settings.json is `true`.
Start the container with the `--network=host` option so clients can automatically find LAN games. Refer to the Quick Start to create the `/opt/factorio` directory.
```
```shell
sudo docker run -d \
--network=host \
-p 34197:34197/udp \
@ -308,24 +343,26 @@ sudo docker run -d \
factoriotools/factorio
```
## Vagrant
## Deploy to other plaforms
### 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.
```
```ruby
config.vm.network "public_network"
config.vm.network "forwarded_port", guest: 34197, host: 34197
```
## Amazon Web Services (AWS) Deployment
### Amazon Web Services (AWS) Deployment
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
**My server is listed in the server browser, but nobody can connect**
### My server is listed in the server browser, but nobody can connect
Check the logs. If there is the line `Own address is RIGHT IP:WRONG PORT`, then this could be caused by the Docker proxy. If the the IP and port is correct it's probably a port forwarding or firewall issue instead.
@ -333,20 +370,19 @@ By default, Docker routes traffic through a proxy. The proxy changes the source
To fix the incorrect port, start the Docker service with the `--userland-proxy=false` switch. Docker will route traffic with iptables rules instead of a proxy. Add the switch to the `DOCKER_OPTS` environment variable or `ExecStart` in the Docker systemd service definition. The specifics vary by operating system.
**When I run a server on a port besides 34197 nobody can connect from the server browser**
### When I run a server on a port besides 34197 nobody can connect from the server browser
Use the `PORT` environment variable to start the server on the a different port, .e.g. `docker run -e "PORT=34198"`. This changes the source port on the packets used for port detection. `-p 34198:34197` works fine for private servers, but the server browser detects the wrong port.
# Contributors
## Contributors
* [dtandersen](https://github.com/dtandersen) - Maintainer
* [Fank](https://github.com/Fankserver) - Keeper of the Factorio watchdog that keeps the version up-to-date.
* [SuperSandro2000](https://github.com/supersandro2000) - CI Guy, Maintainer and runner of the Factorio watchdog, contributed version updates
* [Fank](https://github.com/Fankserver) - Programmer of the Factorio watchdog that keeps the version up-to-date.
* [SuperSandro2000](https://github.com/supersandro2000) - CI Guy, Maintainer and runner of the Factorio watchdog. Contributed version updates and wrote the Travis scripts.
* [DBendit](https://github.com/DBendit/docker_factorio_server) - Coded admin list, ban list support and contributed version updates
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Original Author
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Coded randomly generated RCON password
* [gnomus](https://github.com/gnomus/docker_factorio_server) - Coded wite listing support
* [gnomus](https://github.com/gnomus/docker_factorio_server) - Coded white listing support
* [bplein](https://github.com/bplein/docker_factorio_server) - Coded scenario support
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Contributed version updates
* [carlbennett](https://github.com/carlbennett) - Contributed version updates and bugfixes

395
README_zh_CN.md Normal file
View File

@ -0,0 +1,395 @@
# Factorio-异星工厂 [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) ![Updater status](https://img.shields.io/endpoint?label=Updater%20status&logo=a&url=https%3A%2F%2Fhealthchecks.supersandro.de%2Fbadge%2F1a0a7698-445d-4e54-9e4b-f61a1544e01f%2FBO8VukOA%2Fmaintainer.shields) [![Docker Version](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://hub.docker.com/r/factoriotools/factorio/) [![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/) [![Microbadger Layers](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com")
版本信息可以在[这里](https://github.com/factoriotools/factorio-docker/blob/master/README.md#factorio------)找到
## 标签描述
* `latest` - 最新版本 (可能含有实验性功能).
* `stable` - 最新的稳定版本 [factorio.com](https://www.factorio.com).
* `0.x` - 某个分支上的最新版本
* `0.x.y` - 具体的版本
* `0.x-z` - 在该版本上的增量更新
## 什么是 Facotrio
> 摘录自 [steam factorio 页面](https://store.steampowered.com/app/427520/Factorio/)
「异星工厂」Factorio 是一款建造工业生产流水线并保持其高效运转的游戏。
在游戏中,你可以抠矿、搞科研、盖工厂、建设自动生产流水线,同时还要与异星虫子们互相伤害。
你将从一无所有艰辛起步。挥斧砍树,抡镐抠矿,手搓机械臂和传送带,然而像这样一直搞下去并没有什么卵用。因此,你需要高效的大规模发电厂,庞大的石油化工体系,壮观的全自动化产业链,以及替你东奔西走的机器人大队,让你成为物资储备丰盈工业帝国的真正操控者!
然而,总有一群刁民想害你。这个星球上的土著虫群对你在自家后院里瞎折腾的行为很不爽,总有一天这群刁民会联合起来找你麻烦。因此,你要制造武器、建立防御、准备镇压,让它们知道谁才是真正的主宰者。
你可以在多人游戏中加入不同的阵营,在大触们的带领下与朋友们分工协作, 一起建设恢弘无比的工业园区。
Factorio的模组支持吸引了全世界的设计师参与到对游戏的完善和革新中来从优化调整到游戏辅助甚至对游戏的彻底翻新日新月异的模组将为你不断提供新的乐趣。
除了游戏核心的自由模式和沙盒模式之外任务包还提供了更多不同形式的游戏挑战这已经作为一个免费的DLC提供给玩家了。
对随机生成的地图不满意?不满足于原生游戏任务?这都不是事儿。通过内置的地图编辑器,你可以任意修改地图,配置地形、建筑、敌人等各种元素。如果你是大触,还可以添加自定义脚本,让你的游戏更具独创性、更加阴吹思婷!
**注意**:这个仓库仅包含游戏服务端. 游戏本体可以在 [factorio.com](factorio.com)、 [Steam](https://store.steampowered.com/app/427520/Factorio/)、[GOG.com](https://www.gog.com/game/factorio) 和 [Humble Bundle](https://www.humblebundle.com/store/factorio) 上找到。
## 使用方法
### 快速入门
运行服务端以在指定目录下生成必要的配置文件以及存档,`/opt/factorio` 也许是一个不错的选择。
```shell
sudo mkdir -p /opt/factorio
sudo chown 845:845 /opt/factorio
sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
factoriotools/factorio
```
这样一来, 服务端会使用 `/opt/factorio/saves` 中最新的存档进行游戏。
你一定想知道上面那些咒语是什么意思:
* `-d` - 以守护进程方式运行 ("detached")。
* `-p` - 暴露宿主机 (host) 某些端口。
* `-v` - 将宿主机中 `/opt/factorio` 目录挂载到docker容器的 `/factorio` 目录。
* `--restart` - 在宿主重启或服务端运行崩溃后重启服务端。
* `--name` - 将docker容器命名为 "factorio" (否则docker会给他随机起一个搞怪名字)。
`chown` 命令用来更改服务端所在目录的所有权用户以及用户组为了安全起见我们并不希望游戏直接在root用户权限下运行因此将用户id更改为845从而服务端允许该用户在目录中进行读、写、运行操作。
查看日志以搞清楚发生了什么。
```shell
docker logs factorio
```
停止docker容器 (服务端)。
```shell
docker stop factorio
```
在运行过服务端之后可以在 `/opt/factorio/config` 目录中找到 `server-settings.json` 文件,修改改文件以定制你自己的服务端。
```shell
docker start factorio
```
现在试试连接服务端。如果没有正常运行的话请按照上面步骤查看日志。
### Console-终端
为了运行在服务端终端中运行命令,需要通过 `-it` 参数在交互模式下启动服务端。通过 `docker attach` 连接终端从而可以输入命令。
```shell
docker run -d -it \
--name factorio \
factoriotools/factorio
docker attach factorio
```
### 升级服务端
在升级服务端之前请务必**备份存档**,在客户端(也就是你的游戏中)备份存档相当容易(保存就好)。
请确保在启动服务端时使用了 `-v` 参数,从而服务端将会把存档写在你指定的挂在目录中。`docker rm` 命令会彻底删除运行 facotrio 服务端的容器,也同时会删除容器的整个文件系统实例,因此如果没有挂载外部目录的话,存档也会被删除哦。
```shell
docker stop factorio
docker rm factorio
docker pull factoriotools/factorio
```
然后就像前面说的那样启动服务端,大概一分钟后新的服务端就已经在运行中啦,并且存档和设置还和原来一样!
### 存档
在第一次运行服务端的时候,服务端会根据 `/opt/factorio/config` 目录中的 `map-gen-settings.json``map-settings.json` 配置文件的内容,在 `/opt/factorio/saves` 目录下会生成一张新地图(存档)`_autosave1.zip`。之后如果在停掉之后再次运行,服务端会载入最新的存档。
如果想要运行一个旧存档,你需要停止运行中的服务端,并且运行一个命令 `touch oldsave.zip`。 这会重置其日期,然后重新启动服务端。或者你可以通过删除所有其他存档只留下想要运行的存档来完成同样的目的。
如果想生成一个新的存档,你需要停止运行中的服务端,然后删除所有的存档再启动服务端就好。
#### 在运行命令中直接指定存档(需要 0.17.79-2+ 版本)
你可以在启动服务端时通过设置一个特殊的环境变量来载入一个特定的存档:
设置 `SAVE_NAME``saves` 中你想运行的存档名,去掉 `.zip` 后缀:
```shell
sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
-e LOAD_LATEST_SAVE=false \
-e SAVE_NAME=replaceme \
--name factorio \
--restart=always \
factoriotools/factorio
```
若要生成一个新存档,设置 `GENERATE_NEW_SAVE=true`,同时指定存档名 `SAVE_NAME`
```shell
sudo docker run -d \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
-e LOAD_LATEST_SAVE=false \
-e GENERATE_NEW_SAVE=true \
-e SAVE_NAME=replaceme \
--name factorio \
--restart=always \
factoriotools/factorio
```
### Mods-模组
将模组拷贝至 `mods` 目录下,然后重启服务端即可。
对于 `0.17` 及以上版本,新增 `UPDATE_MODES_ON_START` 环境变量,如果将其设置为 `true`,在服务端启动时将会更新所有的模组。请注意,应用此设置时,必须通过 docker secrets、环境变量或者在 `server-settings.json` 中填写相应字段来提供一个合法的 [Facotrio 用户名以及 Token](https://www.factorio.com/profile),否则服务端就不会启动。
### Scenarios-场景
如果你希望新启动一个场景(而不是从某一个存档中启动),你需要通过另一个备选 `entrypoint` 来启动我们的 factorio-docker 镜像:通过运行以下命令,使用 `/factorio/entrypoints` 目录中的示例 entrypoint 文件来启动服务端。仔细观察后就能发现这只是在之前的命令基础上增加了 `--entrypoint` 设置并在最后新增了一个参数用来指示 `scenarios` 目录中想要启动的场景的文件名。
```shell
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
```
### 将场景转换为常规地图
如果你想把你的场景导出为一个常规的地图存档,类似启动一个新的场景,我们可以通过一个备选 `entrypoint` 文件来达到这个效果:服务端在运行后会将场景转换成一个常规地图存档放置在你的 `saves` 目录中,然后你就可以像平常那样启动服务端了。
```shell
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
在 config/rconpw 文件中设置RCON密码。 如果 rconpw 文件不存在,将会自动生成含有随机密码的该文件。
如果想要更改密码请停止服务端编辑rconpw文件并重启服务端。
如果想要禁用RCON请不要在启动命令中加入 -p 27015:27015/tcp 参数在宿主机服务器中停止暴露rcon端口这时RCON将继续在docker容器中运行但不可达。
### 白名单 (0.15.3+)
创建文件 `config/server-whitelist.json` 然后将用户名加入到该json中。
```json
[
"you",
"friend"
]
```
### 黑名单 (0.17.1+)
创建文件 `config/server-banlist.json` 然后将用户名加入到该json中。
```json
[
"bad_person",
"other_bad_person"
]
```
### 管理员列表 (0.17.1+)
创建文件 `config/server-adminlist.json` 然后将用户名加入到该json中。
```json
[
"you",
"friend"
]
```
### 自定义配置文件 (0.17.x+)
原始的 factorio 服务端并不支持在配置文件中添加环境变量,这里提供一个变通办法:通过在 docker-compose 中使用 `envsubst` 命令,在服务端启动时根据环境变量来动态生成配置文件:
下面的例子将用相应的环境变量来填充 `server-settings.json` 中的字段。
```yaml
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"
```
`server-settings.json` 中可能提供一些供环境变量来替换的字段:
```json
"name": "${INSTANCE_NAME}",
"description": "${INSTANCE_DESC}",
```
### 容器相关的细节
[保持简单](http://wiki.c2.com/?KeepItSimple)的哲学。
+ 服务端应当可以自启动
+ 在环境变量和配置文件中倾向于配置文件
+ 只使用一个数据卷(挂载目录)
### 数据卷
为了保持简单,我们的 docker 服务端只使用一个数据卷挂载到容器中的 `/factorio` 目录。其中包含了所有的配置,模组和存档。
在这个数据卷中所有的文件应当被 uid 为 845 的 factorio 专有用户所拥有(为了安全)
```text
factorio
|-- config
| |-- map-gen-settings.json
| |-- map-settings.json
| |-- rconpw
| |-- server-adminlist.json
| |-- server-banlist.json
| |-- server-settings.json
| `-- server-whitelist.json
|-- mods
| `-- fancymod.zip
`-- saves
`-- _autosave1.zip
```
### Docker Compose
[Docker Compose](https://docs.docker.com/compose/install/) 提供了一种便捷的容器运行方式。
首先获取一个 [docker-compose.yml](https://github.com/factoriotools/factorio-docker/blob/master/0.17/docker-compose.yml) 文件。假设你准备使用我们提供的:
```shell
git clone https://github.com/factoriotools/factorio-docker.git
cd docker_factorio_server/0.17
```
或者假设你想自己编写一个:
```shell
version: '2'
services:
factorio:
image: factoriotools/factorio
ports:
- "34197:34197/udp"
- "27015:27015/tcp"
volumes:
- /opt/factorio:/factorio
```
现在通过 cd 命令进入到 `docker-compose.yml` 所在的目录然后运行下面的命令:
```shell
sudo mkdir -p /opt/factorio
sudo chown 845:845 /opt/factorio
sudo docker-compose up -d
```
### 端口
- `34197/udp` - 游戏服务端(必要)。可以通过改变 `PORT` 环境变量来改变。
- `27015/tcp` - RCON可选
## 局域网游戏
确保 `server-settings.json` 中的 `lan` 字段被设置为 `true`
```shell
"visibility":
{
"public": false,
"lan": true
},
```
在启动服务端时假如 `--network=host` 参数,从而客户端可以自动找到局域网游戏,参考 快速入门 章节。
```shell
sudo docker run -d \
--network=host \
-p 34197:34197/udp \
-p 27015:27015/tcp \
-v /opt/factorio:/factorio \
--name factorio \
--restart=always \
factoriotools/factorio
```
## 在其他平台上部署
### Vagrant
[Vagrant](https://www.vagrantup.com/) 是一种通过虚拟机来运行 Docker 的便捷方式。 在 [Factorio Vagrant box repository](https://github.com/dtandersen/factorio-lan-vagrant) 中有一个示例的 Vagrantfile。
对于局域网游戏Vagrant 虚拟机需要一个内部 IP 从而使游戏可达。一种方式是通过在一个空开网络中部署。虚拟机使用 DHCP 方式来获取一个 IP 地址。同时必须转发到 34197 端口。
```ruby
config.vm.network "public_network"
config.vm.network "forwarded_port", guest: 34197, host: 34197
```
### AWS 部署
如果你想找一个傻瓜教程,请看这个[仓库](https://github.com/m-chandler/factorio-spot-pricing)。这个仓库中包含一个可以让你在几分钟内在 AWS 上搭建服务端的 CloudFormation 模板。同时它支持 Spot Pricing 因此费用会非常便宜,而且你可以在不用的时候把服务器关掉。
## 疑难杂症
### 我可以在服务器列表中看到我的服务器但就是无法连接
查看 log如果有一行说 `Own address is RIGHT IP:WRONG PORT`,那么这个问题就有可能是 Docker Proxy 导致的。 如果 IP 和端口都是正确的,那么有可能是端口转发或者防火墙出了问题。
在默认情况下Docker 通过一个代理来转发网络请求。这个代理会改变 UDP 端口,因此会监测到上面的端口错误。更多细节请移步 *[Incorrect port detected for docker hosted server](https://forums.factorio.com/viewtopic.php?f=49&t=35255)*
为了修复错误端口问题,在启动 Docker 服务时加上 `--userland-proxy=false`。这样一来 Docker 就会通过 iptables 来转发请求从而不走代理。可以通过设置 `DOCKER_OPTS` 环境变量或者改变 Docker systemd service 中的 `ExecStart` 字段来添加这一参数。不同的操作系统可能有不同的配置方式。
### 我不用 34197 端口就没人可以连我的服务器
如果一定要改端口,请使用 `PORT` 环境变量更改。例如 `docker run -e PORT=34198`。这样会更改端口监测中的目标端口。通过 `-p 34198:34197` 方式更改端口对于私人服务器来说是可行的,但这样一来服务器浏览器就没有办法检测到正确的端口了。
## 贡献者
* [dtandersen](https://github.com/dtandersen) - Maintainer
* [Fank](https://github.com/Fankserver) - Programmer of the Factorio watchdog that keeps the version up-to-date.
* [SuperSandro2000](https://github.com/supersandro2000) - CI Guy, Maintainer and runner of the Factorio watchdog. Contributed version updates and wrote the Travis scripts.
* [DBendit](https://github.com/DBendit/docker_factorio_server) - Coded admin list, ban list support and contributed version updates
* [Zopanix](https://github.com/zopanix/docker_factorio_server) - Original Author
* [Rfvgyhn](https://github.com/Rfvgyhn/docker-factorio) - Coded randomly generated RCON password
* [gnomus](https://github.com/gnomus/docker_factorio_server) - Coded wite listing support
* [bplein](https://github.com/bplein/docker_factorio_server) - Coded scenario support
* [jaredledvina](https://github.com/jaredledvina/docker_factorio_server) - Contributed version updates
* [carlbennett](https://github.com/carlbennett) - Contributed version updates and bugfixes
* [Thrimbda](https://github.com/Thrimbda) - 中文翻译

View File

@ -1,10 +1,10 @@
#!/bin/bash
set -eoux pipefail
if [[ -z ${1:-} ]] && [[ -n ${CI:-} ]]; then
echo "Usage: ./build.sh \$VERSION_SHORT"
if [[ -z ${1:-} && -n ${CI:-} ]]; then
echo 'Usage: ./build.sh VERSION_SHORT'
exit 1
elif [[ $CI == true ]]; then
elif [[ ${CI:-} == true || -n ${1:-} ]]; then
VERSION_SHORT="$1"
else
VERSION_SHORT=$(find . -maxdepth 1 -type d | sort | tail -1 | grep -o "[[0-9]].[[0-9]]*")
@ -16,61 +16,90 @@ cd "$VERSION_SHORT" || exit 1
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"
BRANCH=${GITHUB_REF#refs/*/}
if [[ -n ${GITHUB_BASE_REF:-} ]]; then
TAGS="-t $DOCKER_REPO:$GITHUB_BASE_REF"
else
# we are either on master or on a tag build
if [[ $TRAVIS_BRANCH == master ]] || [[ $TRAVIS_BRANCH == "$VERSION" ]]; then
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we are on an incremental build of a tag
elif [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then
TAGS="$DOCKER_REPO:$TRAVIS_BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we build a other branch than master
elif [[ -n $TRAVIS_BRANCH ]]; then
TAGS="$DOCKER_REPO:$TRAVIS_BRANCH"
# we are not in CI and tag version and version short
elif [[ $CI == "" ]]; then
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
if [[ -n ${CI:-} ]]; then
# we are either on master or on a tag build
if [[ ${BRANCH:-} == master || ${BRANCH:-} == "$VERSION" ]]; then
TAGS="-t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we are on an incremental build of a tag
elif [[ $VERSION == "${BRANCH%-*}" ]]; then
TAGS="-t $DOCKER_REPO:$BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we build a other branch than master and exclude dependabot branches from tags cause the / is not supported by docker
elif [[ -n ${BRANCH:-} && ! $BRANCH =~ "/" ]]; then
TAGS="-t $DOCKER_REPO:$BRANCH"
fi
else
# we are not in CI and tag version and version short
TAGS="-t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
fi
if [[ -n ${EXTRA_TAG:-} ]]; then
TAGS="$TAGS -t $DOCKER_REPO:$EXTRA_TAG"
IFS=","
for TAG in $EXTRA_TAG; do
TAGS+=" -t $DOCKER_REPO:$TAG"
done
fi
if [[ ${STABLE:-} == "$VERSION" ]]; then
TAGS+=" -t $DOCKER_REPO:stable"
fi
fi
# shellcheck disable=SC2086
docker build . -t $TAGS
# Travis gets rate limited by Docker HUB.
if [[ ${CI:-} == true && -n ${DOCKER_PASSWORD:-} && -n ${DOCKER_USERNAME:-} ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
# shellcheck disable=SC2068
eval docker build . ${TAGS[@]:-}
docker images
# only push when:
# latest changes where made in the folder corosponding to the version we build, we are on master and don#t build a PR.
if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRAVIS_BRANCH == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] ||
# we build a tag and we are not on master
[[ $VERSION == "${TRAVIS_BRANCH%-*}" ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] ||
# we are not in CI
[[ $CI == "" ]]; then
# remove -1 from incremental tag
# eg before: 0.18.24-1, after 0.18.24
if [[ ${BRANCH:-} ]]; then
BRANCH_VERSION=${BRANCH%-*}
fi
if [[ $CI == true ]]; then
# only push when:
# or we build a tag and we don't build a PR
if [[ $VERSION == "${BRANCH_VERSION:-}" && ${GITHUB_BASE_REF:-} == "" ]] ||
# or we are not in CI
[[ -z ${CI:-} ]]; then
if [[ ${CI:-} == true ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
# push a tag on a branch other than master
if [[ -n $TRAVIS_BRANCH ]] && [[ $VERSION != "${TRAVIS_BRANCH%-*}" ]] && [[ $TRAVIS_BRANCH != "master" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
# push a tag on a branch other than master except dependabot branches cause docker does not support /
if [[ -n ${BRANCH:-} && $VERSION != "${BRANCH_VERSION:-}" && ${BRANCH:-} != "master" && ! ${BRANCH:-} =~ "/" ]]; then
docker push "$DOCKER_REPO:$BRANCH"
fi
# push an incremental tag
if [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
# eg 0.18.24-1
if [[ $VERSION == "${BRANCH_VERSION:-}" ]]; then
docker push "$DOCKER_REPO:$BRANCH"
fi
if [[ -n $TRAVIS_TAG ]] || [[ $CI == "" ]]; then
# only push on tags or when manually running the script
if [[ -n ${BRANCH_VERSION:-} || -z ${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"
IFS=","
for TAG in $EXTRA_TAG; do
docker push "$DOCKER_REPO:$TAG"
done
fi
if [[ ${STABLE:-} == "$VERSION" ]]; then
docker push "$DOCKER_REPO:stable"
fi
curl -X POST https://hooks.microbadger.com/images/factoriotools/factorio/TmmKGNp8jKcFqZvcJhTCIAJVluw=