Allow to specify Docker entrypoint using parameters #409
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.
Using the
composer/satisimage is neat, because thanks to being the entrypoint to the container, you can call the container as you would the binary itself. Of course this is not always what you want and thanks for documenting the way in the readme using custom--entrypoint. Unfortunately sometimes you do not control the way the container is being run - typicaly in a docker "cloud", an example of this being the builds in GitLab.I have dug into this and found out, that a lot of images, which are packaged binaries by default allow to specify a different entrypoint using command line parameters. Great example of this is the official php images. If you run them without parameters, you get the interactive shell. If you run them with a parameter (and its not an PHP parameter) then this is used as entrypoint.
This is achieved with a custom entrypoint script. I have adapted it for the pupose of Satis in this PR and I think it works pretty well.
Here are some situations before and after:
before:
after:
before:
after:
before:
after:
before:
after:
sudo docker run --rm -it satis:docker-entrypoint /bin/sh /satis #before:
after:
As you can see the usual behavior does not change, only when intented and with the side effect that the unrecognized commands would behave differently. Please tell me if I have missed some case.
You can now run info about the other tools in the package, for example Composer: