-
Notifications
You must be signed in to change notification settings - Fork 27
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: use CMD/ENTRYPOINT from source image by default #167
feat: use CMD/ENTRYPOINT from source image by default #167
Conversation
Signed-off-by: gardar <[email protected]>
Signed-off-by: gardar <[email protected]>
Signed-off-by: gardar <[email protected]>
ping @nywilken @SwampDragons |
…ted from `run_command` Signed-off-by: gardar <[email protected]>
…trypoint Signed-off-by: gardar <[email protected]>
Can we get this approved and merged? I would love to start using this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gardar,
Thanks for the patch, this looks good to me!
I'll merge this PR and release the plugin today with that fix in.
FYI: the new step wasn't |
Thanks! |
} | ||
if !hasEntrypoint && defaultEntrypoint != "" { | ||
config.Changes = append(config.Changes, "ENTRYPOINT "+defaultEntrypoint) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change broke our builds because if both values are defined they are connected. We only defined ENTRYPOINT
and got the CMD
from the base image which then was used as default arguments in our entrypoint.
With this change the images built will by default get the CMD and ENTRYPOINT from the source image if not overwritten by a user in the
changes
configuration option.This replicates the behavior when building images from a Dockerfile.
I found numerous complaints which all seem to be related to the behaviour of the docker builder overwriting the CMD / ENTRYPOINT which this change should solve. (Kind of surprising to see that this hasn't been fixed yet 😵)
Closes #158
Closes #132
Closes #13
Closes #9
Closes hashicorp/packer#4914