Skip to content

Conversation

@rumpl
Copy link
Owner

@rumpl rumpl commented Jul 27, 2022

docker build and buildx works with this code.

Comment on lines 267 to 282
if req.Exporter != "" {
req.Exporter = client.ExporterImage
exp, err := w.Exporter(req.Exporter, c.opt.SessionManager)
if err != nil {
return nil, err
}
reposAndTags, err := sanitizeRepoAndTags(strings.Split(req.ExporterAttrs["name"], ","))
if err != nil {
return nil, err
}
var names []string
for _, tag := range reposAndTags {
names = append(names, tag.String())
}

req.ExporterAttrs["name"] = strings.Join(names, ",")
Copy link
Owner Author

Choose a reason for hiding this comment

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

@tonistiigi without this change docker buildx build -t test will create an image named test but not docker.io/library/test, any ideas why this happens?

With a normal daemon buildx build will give the image the canonical name but for some reason here it doesn't. I tried to understand what is going on but I don't really know who canonicalizes the name, buildx or the daemon?

Copy link
Owner Author

Choose a reason for hiding this comment

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

An issue is created for this over at moby/buildkit#2986

@rumpl rumpl changed the title Make build work, buildx doesn't work yet Make build work Jul 27, 2022
@rumpl rumpl force-pushed the feat-build branch 2 times, most recently from 896277a to 84c83cf Compare July 28, 2022 09:05
Copy link
Collaborator

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM; also tested it with some simple Dockerfiles on my side and seems to work

Signed-off-by: Djordje Lukic <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants