Skip to content
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

feat(Dockerfile): switch cmd to entrypoint #119

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

SimJoSt
Copy link

@SimJoSt SimJoSt commented Aug 7, 2021

By using ENTRYPOINT for the default command, it is possible to extend the command with arguments by using CMD in a custom Dockerfile. As the command itself doesn't need to be changed/overwritten with this approach, changes to the location of the binary or command will not break these configurations in the future.

Copy link

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also makes it easier to poke around inside the container by passing a shell as the --entrypoint arg at runtime.

@Pytal
Copy link
Member

Pytal commented Aug 9, 2021

@SimJoSt checks require a signoff :)

git commit --amend --no-edit --signoff
git push --force-with-lease origin feat/Dockerfile/switch-cmd-to-entrypoint

@Pytal Pytal requested a review from icewind1991 August 9, 2021 20:33
@icewind1991
Copy link
Member

The problem with changing that now is that it would break all existing setups that use the existing CMD overwrite

@Pytal
Copy link
Member

Pytal commented Aug 18, 2021

The problem with changing that now is that it would break all existing setups that use the existing CMD overwrite

True, I do still think this is a good Docker standard to follow though :) Should we reconsider this when we near 1.0?

By using `ENTRYPOINT` for the default command, it is possible to extend the command with arguments by using `CMD` in a custom Dockerfile. As the command itself doesn't need to be changed/overwritten with this approach, changes to the location of the binary or command will not break these configurations in the future.

Signed-off-by: Joda Stößer <git@simjo.st>
@SimJoSt SimJoSt force-pushed the feat/Dockerfile/switch-cmd-to-entrypoint branch from 59e9e72 to baace31 Compare June 19, 2023 02:20
Signed-off-by: Joda Stößer <git@simjo.st>
@SimJoSt SimJoSt force-pushed the feat/Dockerfile/switch-cmd-to-entrypoint branch from 55a63f1 to 167276c Compare June 19, 2023 02:23
@SimJoSt
Copy link
Author

SimJoSt commented Jun 19, 2023

@icewind1991 @Pytal @alerque I finally got a grip on all my PRs and updated this one as well.
So it is ready to be merged when it's time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants