Skip to content

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

Merged
tonistiigi merged 1 commit intodocker:masterfrom
DataDog:mayeul/docker-buildx-rm--keep-buildkitd
Nov 23, 2021
Merged

Add an flag to buildx rm to keep the buildkitd daemon running#852
tonistiigi merged 1 commit intodocker:masterfrom
DataDog:mayeul/docker-buildx-rm--keep-buildkitd

Conversation

@zaymat
Copy link
Copy Markdown
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]

Comment thread commands/rm.go Outdated

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Comment thread docs/reference/buildx_rm.md Outdated
### <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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

zaymat commented Nov 22, 2021

Copy link
Copy Markdown
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