-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autostart on docker on debian not working #426
Comments
My quick repeatable steps for replication of this issue - with Proxmox as the base environment, but should work even if docker is installed in any linux environment with docker and docker compose installed. First create a docker LXC, and use helper scripts to do so. login as root to your proxmox container
git clone this repo
once the docker container is created, navigate to the file(s) to edit them
edit the environment variable to include AUTOSTART all of the files mentioned in the original post with this testing method, and recreated the docker containers each time to make sure there was nothing different between the runs, except for each file edit. |
Same thing happening to me, I've ran in docker on LXC and a full-fledged debian 12 VM and have the same issues in both. It doesn't seem to accept anything either from ENV or the json file method. |
This issue is because flags are not being passed to the factorio server and environment variables are not parsed correctly after starting the container. There are numerous issues and pull requests here to fix this but the maintainer seems to be unable to do so. I managed to get flags working:
Notice the only change I made is I added "$@" at the end as detailed in #413
This should inject a fixed entrypoint.sh. Notice that this does not fix environment variebles ( Also this is likely bad practice as anyone who can edit entrypoint.sh can execute arbitrary commands in the container. Edit: the image ofsm/ofms:develop has environment variables working, so use that with |
Hi I am having trouble getting autostart to work. I have tried all of the flags,env settings, and conf.json's as described below, but in none of the cases do I get the factorio server to start on run of the docker container.
With environment variable FSM_AUTOSTART=true - this server starts the web server, and if i click 'start' in the web ui it does start the game, but no autostart if i restart the container.
docker run --name ofsm -e FACTORIO_VERSION=2.0.23 -e FSM_AUTOSTART=true -v ./fsm-data:/opt/fsm-data -v ./factorio-data/saves:/opt/factorio/saves -v ./factorio-data/mods:/opt/factorio/mods -v ./factorio-data/config:/opt/factorio/config -v ./factorio-data/mod_packs:/opt/fsm/mod_packs -d -p 80:80 -p 34197:34197/udp --restart=always ofsm/ofsm:latest
With flag --autostart - same deal, no autostart, otherwise is functioning.
docker run --name ofsm -e FACTORIO_VERSION=2.0.23 -v ./fsm-data:/opt/fsm-data -v ./factorio-data/saves:/opt/factorio/saves -v ./factorio-data/mods:/opt/factorio/mods -v ./factorio-data/config:/opt/factorio/config -v ./factorio-data/mod_packs:/opt/fsm/mod_packs -d -p 80:80 -p 34197:34197/udp --restart=always ofsm/ofsm:latest --autostart
i also tried --autostart true to test if it required a value, but still not working
docker run --name ofsm -e FACTORIO_VERSION=2.0.23 -v ./fsm-data:/opt/fsm-data -v ./factorio-data/saves:/opt/factorio/saves -v ./factorio-data/mods:/opt/factorio/mods -v ./factorio-data/config:/opt/factorio/config -v ./factorio-data/mod_packs:/opt/fsm/mod_packs -d -p 80:80 -p 34197:34197/udp --restart=always ofsm/ofsm:latest --autostart true
no environment variable, no flag, modified conf.json file
docker run --name ofsm -e FACTORIO_VERSION=2.0.23 -v ./fsm-data:/opt/fsm-data -v ./factorio-data/saves:/opt/factorio/saves -v ./factorio-data/mods:/opt/factorio/mods -v ./factorio-data/config:/opt/factorio/config -v ./factorio-data/mod_packs:/opt/fsm/mod_packs -d -p 80:80 -p 34197:34197/udp --restart=always ofsm/ofsm:latest
Any ideas for what to try next?
The text was updated successfully, but these errors were encountered: