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

support overriding image CMD on commit #552

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

tomfeigin
Copy link
Contributor

This PR adds support for supplying a CMD to override when committing an image

@AkihiroSuda
Copy link
Member

Thanks, but please sign the commit for DCO
https://github.com/apps/dco

(run git commit -a -s --amend, and make sure that the Signed-off-by: NAME <EMAIL> line with your real name is included in the commit message)

@@ -39,6 +39,7 @@ func newCommitCommand() *cobra.Command {
}
commitCommand.Flags().StringP("author", "a", "", `Author (e.g., "nerdctl contributor <[email protected]>")`)
commitCommand.Flags().StringP("message", "m", "", "Commit message")
commitCommand.Flags().StringSlice("override-cmd", nil, "Override image CMD")
Copy link
Member

Choose a reason for hiding this comment

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

This should be like --change='CMD ["apachectl", "-DFOREGROUND"]'
https://docs.docker.com/engine/reference/commandline/commit/

@AkihiroSuda AkihiroSuda added the enhancement New feature or request label Nov 22, 2021
@tomfeigin tomfeigin force-pushed the override_cmd_on_commit branch 4 times, most recently from c094fe6 to a2cdf40 Compare November 22, 2021 15:52
@AkihiroSuda
Copy link
Member

Please squash commits (git rebase -i HEAD~2)

@@ -39,6 +41,7 @@ func newCommitCommand() *cobra.Command {
}
commitCommand.Flags().StringP("author", "a", "", `Author (e.g., "nerdctl contributor <[email protected]>")`)
commitCommand.Flags().StringP("message", "m", "", "Commit message")
commitCommand.Flags().StringSliceP("change", "c", nil, "Apply Dockerfile instruction to the created image")
Copy link
Member

Choose a reason for hiding this comment

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

The help string should describe that only CMD instruction is supported currently.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

Support supplying a CMD to override when committing an image

Signed-off-by: Tom Feigin <[email protected]>
@AkihiroSuda
Copy link
Member

Adding docs in #572

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

Successfully merging this pull request may close these issues.

2 participants