Docker: pass on parameters such as --autostart true to the fsm process #413
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's wrong?
While investigating #409 I found an issue with the docker packaging of fsm:
As it stands currently, all command line parameters meant for the fsm process passed when starting a container (with
docker run
or any other method) are ignored becauseentrypoint.sh
does not actually pass them to the process. This is noticeable when trying to use--autostart true
for example.The fix
The change to fix this is tiny: The parameters are forwarded to fsm by appending
"$@"
to the command that startsfactorio-server-manager
.When supplying parameters that are already included in the command (
--conf
,--dir
and--port
), the manually supplied parameters override the included ones, which seems like reasonable behaviour to me. If this is not desired, the"$@"
can be moved to the left so the default arguments take precedence.Impact
This change does not affect the fsm code itself, but can help to mitigate various issues regarding autostart (see #409, #362, #301). The
Dockerfile
pulls the current release for packaging directly from the GitHub releases, so even if the current state of the development branch is not release-ready, this fix can quickly be distributed by updating the image on Docker Hub. Please consider doing so as soon as it's convenient. Thank you!