-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use tonistiigi/xx for cross-platform builds #178
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,13 +12,28 @@ jobs: | |||||
steps: | ||||||
- name: checkout | ||||||
uses: actions/checkout@v2 | ||||||
- name: Setup QEMU | ||||||
uses: docker/setup-qemu-action@v1 | ||||||
with: | ||||||
platforms: all | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we do need it, I suppose this should be set to the subset of platforms we actually do support:
Suggested change
|
||||||
- name: Setup Docker Buildx | ||||||
id: buildx | ||||||
uses: docker/setup-buildx-action@v1 | ||||||
- name: Restore go cache | ||||||
uses: actions/cache@v1 | ||||||
with: | ||||||
path: ~/go/pkg/mod | ||||||
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-go- | ||||||
- name: Cache Docker layers | ||||||
uses: actions/cache@v2 | ||||||
id: cache | ||||||
with: | ||||||
path: /tmp/.buildx-cache | ||||||
key: ${{ runner.os }}-buildx-ghcache-${{ github.sha }} | ||||||
restore-keys: | | ||||||
${{ runner.os }}-buildx-ghcache- | ||||||
- name: Set up Go | ||||||
uses: actions/setup-go@v2 | ||||||
with: | ||||||
|
@@ -28,4 +43,15 @@ jobs: | |||||
- name: Run tests | ||||||
run: make test | ||||||
- name: Build container image | ||||||
run: make docker-build IMG=ghcr.io/fluxcd/${{ github.event.repository.name }}:latest | ||||||
run: | | ||||||
make docker-build IMG=ghcr.io/fluxcd/${{ github.event.repository.name }}:latest \ | ||||||
BUILD_PLATFORMS=linux/amd64 \ | ||||||
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \ | ||||||
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max" | ||||||
- # Temp fix | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can now use |
||||||
# https://github.com/docker/build-push-action/issues/252 | ||||||
# https://github.com/moby/buildkit/issues/1896 | ||||||
name: Move cache | ||||||
run: | | ||||||
rm -rf /tmp/.buildx-cache | ||||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
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.
Do we actually need qemu considering we're only building for
amd64
in this workflow?