Closed bplein closed 5 years ago
I'll have to look at the container scripting, it's possible I left that hard-coded. I may have been assuming that it didn't need to be adjustable internally since it can just be remapped in the Docker, Compose, or other orchestration HOST:CONTAINER networking, assuming you're not using host networking mode. IE:
docker run --name factorio -d \
-p 34197:34197/udp \
-p 27018:27015 \
goofball222/factorio
OR
version: '3'
services:
factorio:
image: goofball222/factorio
container_name: factorio
restart: unless-stopped
ports:
- 27018:27015
- 34197:34197/udp
<snip>
But it can’t! The app is port aware and tells the pingpong host it’s port, even if it’s remapped to another poet by docker networking (or by a router). The external port and the port as it’s understood by the app must match.
At least that’s what I ran into back in the 16.x era.
Easiest change is to always set the game and rcon ports via the CLI, set them via environment variables that have defaults but can be override in the compose file
I may be wrong about the RCON port, it possibly could get redirected. I was thinking about the game port which cannot.
I can see where the "FACTIORIO_RCON_PORT" is getting overwritten in the startup script now that I look at it with that in mind, should be fairly simple to fix. I'll also go ahead and add a "FACTORIO_PORT" variable to allow that to be adjusted as well while I'm fixing the first one. I'll close this issue out once those changes are committed.
These changes will be applied to both the experimental and stable images, however the existing static images releases on Docker hub will not be updated.
Reporting bugs/issues
$ docker inspect goofball222/factorio:experimental "Labels": { "org.label-schema.build-date": "2019-03-07T16:35:30Z", "org.label-schema.license": "Apache-2.0", "org.label-schema.name": "Factorio Headless Server", "org.label-schema.schema-version": "1.0", "org.label-schema.url": "https://github.com/goofball222/factorio", "org.label-schema.vcs-ref": "93ac8bf", "org.label-schema.vcs-url": "https://github.com/goofball222/factorio.git", "org.label-schema.vendor": "The Goofball - goofball222@gmail.com", "org.label-schema.version": "0.17.8" }
docker logs -f factorio4
2019-03-07T18:20:19.754 INFO - Script version 1.0.1
2019-03-07T18:20:19.757 INFO - Entrypoint running with UID 0 (root)
2019-03-07T18:20:19.760 INFO - GID/UID for factorio are unchanged: GID=999, UID=999
2019-03-07T18:20:19.765 INFO - RUN_CHOWN set to 'false' - Not running 'chown -R factorio:factorio /opt/factorio', assume permissions are right.
2019-03-07T18:20:19.766 INFO - Using existing RCON.pwd found in /opt/factorio/config
2019-03-07T18:20:19.769 INFO - RCON password is 'f95274fad5687330'
2019-03-07T18:20:19.772 INFO - Copied latest server-settings.example.json to /opt/factorio/config
2019-03-07T18:20:19.774 INFO - Copied latest map-gen-settings.example.json to /opt/factorio/config
2019-03-07T18:20:19.776 INFO - Using existing server-settings.json found in /opt/factorio/config
2019-03-07T18:20:19.778 INFO - Using existing map-gen-settings.json found in /opt/factorio/config
2019-03-07T18:20:19.780 INFO - Loading save.zip found in /opt/factorio/saves
2019-03-07T18:20:19.782 INFO - Use su-exec to drop priveleges and start Factorio Headless as GID=999, UID=999
2019-03-07T18:20:19.783 EXEC - su-exec factorio:factorio /opt/factorio/bin/x64/factorio "--port 34200 --rcon-port 27018 --rcon-password f95274fad5687330 --rcon-port 27015 --start-server-load-latest --server-settings /opt/factorio/config/server-settings.json
0.000 Error Main.cpp:487: Both --rcon-port and --rcon-password must be specified to enable RCON