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

build: wip use buildx to build multi-platform docker images #30528

Closed
wants to merge 2 commits into from

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Sep 30, 2024

This is a work in progress of a buildx-based docker image creator. Our current builder is very complicated:

  • Use multiple builders, on different platforms (arm vs amd).
  • They build and push their own native platform
  • One of them (random which, decided by a race) generates a manifest image, which basically says "stable == stable-amd64 and/or stable/amd64".

With docker buildx, we can build all archs in one go.

If I run this on master (to disable the maybeSkipArchive), and set DryRun to true in util.go and execute, these are the actions it would have attempted:

[user@work go-ethereum]$ go run build/ci.go dockerx  -manifest amd64,arm64 -upload ethereum/client-go 
>>> docker buildx --build-arg COMMIT=283be238172c8ae3a05f97e2f3c159f5c2319e07 --build-arg VERSION=1.14.11-unstable --build-arg BUILDNUM= --tag ethereum/client-go:latest-amd64 --platform amd64 --load --push --file Dockerfile .
>>> docker buildx --build-arg COMMIT=283be238172c8ae3a05f97e2f3c159f5c2319e07 --build-arg VERSION=1.14.11-unstable --build-arg BUILDNUM= --tag ethereum/client-go:latest-arm64 --platform arm64 --load --push --file Dockerfile .
>>> docker buildx imagetools create --tag ethereum/client-go:latest ethereum/client-go:latest-amd64 ethereum/client-go:latest-arm64
>>> docker buildx --build-arg COMMIT=283be238172c8ae3a05f97e2f3c159f5c2319e07 --build-arg VERSION=1.14.11-unstable --build-arg BUILDNUM= --tag ethereum/client-go:alltools-latest-amd64 --platform amd64 --load --push --file Dockerfile.alltools .
>>> docker buildx --build-arg COMMIT=283be238172c8ae3a05f97e2f3c159f5c2319e07 --build-arg VERSION=1.14.11-unstable --build-arg BUILDNUM= --tag ethereum/client-go:alltools-latest-arm64 --platform arm64 --load --push --file Dockerfile.alltools .
>>> docker buildx imagetools create --tag ethereum/client-go:alltools-latest ethereum/client-go:alltools-latest-amd64 ethereum/client-go:alltools-latest-arm64

Now, this is a bit gnarly to experiment with on travis, and I also don't want to bork the existing images. So maybe I'll just push to a new tag, e.g., instead of ethereum/client-go, we could use ethereum/client-gox until it works?

@holiman holiman closed this Sep 30, 2024
@holiman
Copy link
Contributor Author

holiman commented Sep 30, 2024

replaced by #30530

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.

1 participant