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

Add an flag to buildx rm to keep the buildkitd daemon running #852

Merged

Conversation

zaymat
Copy link
Contributor

@zaymat zaymat commented Nov 19, 2021

This PR adds the flag --keep-buildkitd to the buildx rm command to preserve the buildkitd daemon after the buildx context is deleted.

This flag can be useful when someone uses the kubernetes driver and manages the buildkit deployment outside of buildx.

docker buildx rm --help

  Usage:  docker buildx rm [NAME]
  
  Remove a builder instance
  
  Options:
        --builder string   Override the configured builder instance
        --keep-buildkitd   Keep the buildkitd daemon running
        --keep-state       Keep BuildKit state

Fixes #794

Signed-off-by: Mayeul Blanzat [email protected]

commands/rm.go Outdated
@@ -70,23 +71,28 @@ func rmCmd(dockerCli command.Cli, rootOpts *rootOptions) *cobra.Command {

flags := cmd.Flags()
flags.BoolVar(&options.keepState, "keep-state", false, "Keep BuildKit state")
flags.BoolVar(&options.keepBuildkitd, "keep-buildkitd", false, "Keep the buildkitd daemon running")
Copy link
Member

Choose a reason for hiding this comment

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

I think --keep-instance would be a better name.

Copy link
Member

Choose a reason for hiding this comment

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

@crazy-max maybe --keep-daemon? "Instance" is not very descriptive either as anything can have "an instance".

Copy link
Member

Choose a reason for hiding this comment

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

yes --keep-daemon sgtm 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

--keep-daemon sgtm too 👍

I'll make the change

@@ -34,7 +34,7 @@ Same as [`buildx --builder`](buildx.md#builder).
Keep BuildKit state, so it can be reused by a new builder with the same name.
Currently, only supported by the [`docker-container` driver](buildx_create.md#driver).

### <a name="keep-buildkitd"></a> Keep the buildkitd daemon running (--keep-buildkitd)
### <a name="keep-daemon"></a> Keep the buildkitd daemon running (--keep-daemon)

Keep the buildkitd daemon running after the buildx context is removed. This is useful is when you manage buildkitd daemons and buildx contexts independently.
Copy link
Member

Choose a reason for hiding this comment

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

This is useful is when > This is useful when

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

Add --keep-daemon to the `rm` command option to preserve the buildkitd daemon after the buildx context is deleted.

Signed-off-by: Mayeul Blanzat <[email protected]>
@zaymat zaymat force-pushed the mayeul/docker-buildx-rm--keep-buildkitd branch from 8866bb2 to 72dab55 Compare November 22, 2021 12:46
@zaymat
Copy link
Contributor Author

zaymat commented Nov 22, 2021

Please also squash the commits. https://github.com/docker/buildx/blob/master/.github/CONTRIBUTING.md#review

Sure 👍 Just did it

Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

LGTM

@tonistiigi tonistiigi merged commit 1927dba into docker:master Nov 23, 2021
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.

Docker buildx rm always deletes buildkit Kubernetes deployments
3 participants