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

history: add export command #3073

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

Conversation

tonistiigi
Copy link
Member

Allow builds to be exported into .dockerbuild bundles that can be shared and imported into Docker Desktop.

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.

When exporting a build record and importing it back, the name is not the same:

image

I think this is because we don't check the local state for imported builds in desktop-build backend on Docker Desktop. Maybe we could set the builder and node name as annotation in the export bundle so we can look if a local state exists for this ref? WDYT?

cmd := &cobra.Command{
Use: "export [OPTIONS] [REF]",
Short: "Export a build into Docker Desktop bundle",
Args: cobra.MaximumNArgs(1),
Copy link
Member

Choose a reason for hiding this comment

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

If we want feature parity with export-build tool, I think we should allow multiple refs to be exported. This is needed for GHA case when exporting bake builds.

Also the export-build exports all records for the builder being used if no refs are set but I think to be consistent with other history commands this is fine to export the first one. So maybe we could have an --all flag for such case?


cmd := &cobra.Command{
Use: "export [OPTIONS] [REF]",
Short: "Export a build into Docker Desktop bundle",
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if "Docker Desktop" should be stipulated here. I think the following is enough:

Suggested change
Short: "Export a build into Docker Desktop bundle",
Short: "Export build records",

or

Suggested change
Short: "Export a build into Docker Desktop bundle",
Short: "Export build records bundle",

Copy link
Member

Choose a reason for hiding this comment

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

Also there are some places where we talk about build and other build record. I think we should be consistent:

Short: "Import a build into Docker Desktop",

Import build records into Docker Desktop

Short: "Print the logs of a build",

Print the logs of a build record

Short: "Open a build in Docker Desktop",

Open a build record in Docker Desktop

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if "Docker Desktop" should be stipulated here. I think the following is enough:

It kind of shows what you can do with the bundle file.

@tonistiigi
Copy link
Member Author

Added support for --all and multiple refs.

Allow builds to be exported into .dockerbuild bundles
that can be shared and imported into Docker Desktop.

Signed-off-by: Tonis Tiigi <[email protected]>
@tonistiigi tonistiigi force-pushed the add-trace-export-command branch 4 times, most recently from 367fc9c to 3e56b2e Compare March 21, 2025 03:41
@tonistiigi tonistiigi force-pushed the add-trace-export-command branch from 3e56b2e to 45dfb84 Compare March 21, 2025 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants