-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Native cross-compilation, artifacts and multi-platform image #3315
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
Conversation
Wonderful! Can't wait to chuck Travis CI just in time for the end of the year 👍 |
06565e1
to
cf232a7
Compare
@arkodg I've made some changes to avoid shell scripts and only rely on buildx bake. This allows us to be sandboxed in CI and locally and therefore Docker itself is enough (will also work on Windows where make is not available): # Validate vendor
$ docker buildx bake vendor-validate
# golangci-lint
$ docker buildx bake lint
# Run golangci-lint and vendor-validate
$ docker buildx bake validate
# Update vendor
$ docker buildx bake vendor-update |
Codecov Report
@@ Coverage Diff @@
## main #3315 +/- ##
=======================================
Coverage 56.35% 56.35%
=======================================
Files 101 101
Lines 7307 7307
=======================================
Hits 4118 4118
Misses 2534 2534
Partials 655 655 Continue to review full report at Codecov.
|
dcef75b
to
7c8cb3b
Compare
@milosgajdos As discussed, reviving this PR:
Everything is already in place on https://github.com/crazy-max/docker-distribution as well as the GitHub Actions pipeline if you want to take a look. Here is how to build with buildx: # create builder for multi-arch build and cache feature (see below)
docker buildx create --name distribution-builder --use
# build docker image and output to docker with registry:local tag (default)
docker buildx bake image-local
# build multi-platform image
docker buildx bake image-all
# create the artifact matching your current platform in ./bin
docker buildx bake artifact
# create artifacts for many platforms in ./bin
docker buildx bake artifact-all
# build binary in ./bin/registry
docker buildx bake binary
|
1697423
to
a6b287f
Compare
1f70571
to
edb423b
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
Ref. #3312 docker/buildx#451
This PR will handle validation (lint, vendoring) through GitHub Actions. We keep Travis workflow for now.Handles native cross-compilation in the Dockerfile and also upload artifacts in the workflow and multi-platform image to Docker Hub.
cc. @arkodg @milosgajdos
Signed-off-by: CrazyMax crazy-max@users.noreply.github.com