-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adding multiarch image support #1474
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publish image | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
build: | ||
env: | ||
IMAGE_NAME: gcr.io/kaniko-project/executor | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get latest release tag | ||
uses: oprypin/find-latest-tag@v1 | ||
with: | ||
repository: GoogleContainerTools/kaniko # The repository to scan. | ||
releases-only: true # We know that all relevant tags have a GitHub release for them. | ||
id: kaniko | ||
|
||
- name: Clone source code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ steps.kaniko.outputs.tag }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: latest | ||
|
||
- name: Available platforms | ||
run: echo ${{ steps.buildx.outputs.platforms }} | ||
|
||
- name: Setup gcloud CLI | ||
uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | ||
with: | ||
service_account_key: ${{ secrets.GCR_DEVOPS_SERVICE_ACCOUNT_KEY }} | ||
project_id: kaniko-project | ||
export_default_credentials: true | ||
|
||
- name: Build and push image | ||
run: | | ||
gcloud auth configure-docker -q | ||
IMAGE_VERSION="$(git describe --tags --abbrev=0)" | ||
SHORT_SHA1=$(git rev-parse --short HEAD) | ||
PLATFORMS="linux/amd64,linux/ppc64le,linux/arm64" | ||
echo "Building and pushing version ${IMAGE_VERSION} of image ${IMAGE_NAME}" | ||
docker buildx build --platform "${PLATFORMS}" -t "${IMAGE_NAME}:${IMAGE_VERSION}" -t "${IMAGE_NAME}:latest" -f ./deploy/Dockerfile \ | ||
--push . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
diff --git a/build/build-config-edit.sh b/build/build-config-edit.sh | ||
index d9fffd0..88b83a9 100755 | ||
--- a/build/build-config-edit.sh | ||
+++ b/build/build-config-edit.sh | ||
@@ -13,10 +13,9 @@ if [[ ! -d "$sourcedir" ]]; then | ||
fi | ||
|
||
export CGO_ENABLED=0 | ||
-export GOARCH=amd64 | ||
export GOPATH=$PWD | ||
echo "Go path = $GOPATH" | ||
-for go_os in "linux" "windows" "darwin" | ||
+for go_os in "linux" | ||
do | ||
if [[ "$go_os" == "windows" ]]; then | ||
exe_extension=".exe" | ||
diff --git a/build/build-cred-helper.sh b/build/build-cred-helper.sh | ||
index 0e88315..d016988 100755 | ||
--- a/build/build-cred-helper.sh | ||
+++ b/build/build-cred-helper.sh | ||
@@ -22,9 +22,8 @@ fi | ||
|
||
export BUILDVERSION=acr-docker-credential-helper`date -u +.%Y%m%d.%H%M%S` | ||
export CGO_ENABLED=0 | ||
-export GOARCH=amd64 | ||
export GOPATH=$PWD | ||
-for go_os in "linux" "windows" "darwin" | ||
+for go_os in "linux" | ||
do | ||
export GOOS=$go_os | ||
if [[ "$GOOS" == "windows" ]]; then | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Was this added by mistake?
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.
This patch is required as https://github.com/Azure/acr-docker-credential-helper is hard coded to build for amd64.