-
Notifications
You must be signed in to change notification settings - Fork 521
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
Allow to specify Docker entrypoint using parameters #409
Conversation
Would you mind basing your docker-entrypoint on this one instead? https://github.com/composer/docker/blob/master/docker-entrypoint.sh And changing the Dockerfile to just point to it like this: https://github.com/composer/docker/blob/master/Dockerfile.template#L30-L32 |
Also if I am not mistaken, you will need to add the |
Sure, I can do that, I have no experience with
I put the file in the Let me know if you want me to put it in the root. |
I missed that, my bad. The |
879da8c
to
8df9ae7
Compare
The PR is updated and green. I tested manually again all of the situations above and as expected nothing has changed. Plus there is now handling of Btw I am not sure if we should update the readme section to mention these new possibilities or if it would cram the space too much? |
8df9ae7
to
c408669
Compare
You are welcome to submit some more doc details. See #403 also. But it is not a requirement for this PR. Thanks for your contribution! |
I have now verified, that it is working with GitLab builds now, yay! Thanks for being so responsive about this, saved me a lot of hacking around that :) |
Using the
composer/satis
image 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: