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

configure default builder export when no build.platforms defined #9862

Merged
merged 1 commit into from
Sep 22, 2022

Conversation

glours
Copy link
Contributor

@glours glours commented Sep 20, 2022

What I did
Defined a docker builder exporter by default to make the image available in the engine context

Related issue
fixes #9856

(not mandatory) A picture of a cute animal, if possible in relation with what you did
image

@glours glours requested a review from a team September 20, 2022 13:31
@glours glours self-assigned this Sep 20, 2022
Copy link
Contributor

@milas milas left a comment

Choose a reason for hiding this comment

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

LGTM - small clarity suggestion but also totally good as-is

@@ -81,6 +81,12 @@ func (s *composeService) build(ctx context.Context, project *types.Project, opti
Attrs: map[string]string{"ref": image},
})
}
buildOptions.Exports = []bclient.ExportEntry{{
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: it'd be a bit clearer if it was something like

if len(buildOptions.Platforms) == 0 {
   // docker load
} else { 
  // image out
}

Mostly to make it clear that they're mutually exclusive / an intentional override.

@glours glours merged commit e2a3fe9 into docker:v2 Sep 22, 2022
@glours glours deleted the use-docker-export-if-no-build-platforms branch January 11, 2023 14:22
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.

rm + build + up keeps using the previously existing image for a container (2.11.0)
3 participants