Skip to content

multi platform with multi tags, buildx error #459

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

Closed
yywing opened this issue Dec 2, 2020 · 11 comments
Closed

multi platform with multi tags, buildx error #459

yywing opened this issue Dec 2, 2020 · 11 comments

Comments

@yywing
Copy link

yywing commented Dec 2, 2020

docker buildx build --platform linux/amd64,linux/arm64 --push --pull -t xxxxxx/test:1 -t xxxxxx/test:2 -f nginx.Dockerfile .

 => ERROR merging manifest list xxxxxxx/test:1,xxxxxx/test:2         1.5s
------
 > merging manifest list xxxxxxx/test:1,xxxxxxx/test:2:
------
@yywing
Copy link
Author

yywing commented Dec 3, 2020

And I try to push to dockerhub, and I found build success, but only push the first tag.

@morlay
Copy link
Collaborator

morlay commented Dec 10, 2020

buildkit issue.

create builder with --driver-opt=image=moby/buildkit:v0.8.0

@petethepig
Copy link

create builder with --driver-opt=image=moby/buildkit:v0.8.0

This didn't work for me. Does anyone know of some other workaround? regular docker tag / docker push commands only work with one arch

@petethepig
Copy link

petethepig commented Dec 23, 2020

I figured it out. Here's the workaround I'm using right now:

docker buildx build --tag foo/bar:1.0.0 --platform linux/amd64,linux/arm64 .
docker manifest inspect foo/bar:1.0.0
# returns a json with 2 shas:
# {
#    "schemaVersion": 2,
#    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
#    "manifests": [
#       {
#          "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
#          "size": 1992,
#          "digest": "sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2",
#          "platform": {
#             "architecture": "arm64",
#             "os": "linux"
#          }
#       },
#       {
#          "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
#          "size": 1992,
#          "digest": "sha256:974e592c2fa383d4a3960714caef0c4f2c3ab8ff13720e8ad9047dd39466b3c8",
#          "platform": {
#             "architecture": "amd64",
#             "os": "linux"
#          }
#       }
#    ]
# }
# replace shas with the ones you got from the previous command:
docker manifest create foo/bar:latest \
  foo/bar@sha256:c3ab8ff13720e8ad9047dd39466b3c8974e592c2fa383d4a3960714caef0c4f2 \
  foo/bar@sha256:974e592c2fa383d4a3960714caef0c4f2c3ab8ff13720e8ad9047dd39466b3c8
docker manifest push foo/bar:latest

^ this will build (and push) a multi-arch image with tags 1.0.0 and latest

@morlay
Copy link
Collaborator

morlay commented Dec 30, 2020

@petethepig which version of buildx you used?

@petethepig
Copy link

@morlay

$ docker buildx version
github.com/docker/buildx v0.5.1-docker 11057da37336192bfc57d81e02359ba7ba848e4a

@morlay
Copy link
Collaborator

morlay commented Dec 30, 2020

@petethepig strange.

do you create a new builder with

docker buildx create --use --driver-opt=image=moby/buildkit:v0.8.0

it works well kiali/kiali#3405 (comment)
multi tag published https://quay.io/repository/kiali/kiali?tag=latest&tab=tags
by the builder https://github.com/kiali/kiali/blob/master/make/Makefile.container.mk#L110

@petethepig
Copy link

petethepig commented Dec 30, 2020

@morlay

not sure if it matters, but I also use 2 separate machines like this:

docker buildx create --use --name mybuilder --driver-opt=image=moby/buildkit:v0.8.0 --platform linux/arm64
docker buildx create --append --name mybuilder secondmachine --driver-opt=image=moby/buildkit:v0.8.0 --platform linux/amd64

@morlay
Copy link
Collaborator

morlay commented Dec 30, 2020

@petethepig I use 2 separate machines too. multi tag publishing works well.

try with moby/buildkit:v0.8.1?

the last line log should be the merging
image

@petethepig
Copy link

@morlay thanks! I'll try it soon, not today, but in the next few days.

@yywing
Copy link
Author

yywing commented Dec 31, 2020

moby/buildkit:v0.8.1

not work for me - -

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

No branches or pull requests

3 participants