-
Notifications
You must be signed in to change notification settings - Fork 141
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
Multiarch Docker Image support using GCB #68
Merged
k8s-ci-robot
merged 3 commits into
kubernetes-csi:master
from
linux-on-ibm-z:multiarch-supportGCB
Mar 27, 2020
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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,14 @@ | ||
FROM --platform=$BUILDPLATFORM golang:1.13.3 AS builder | ||
ARG TARGETPLATFORM | ||
ARG BUILDPLATFORM | ||
WORKDIR /code | ||
ADD . /code/ | ||
|
||
RUN cd /code/ && GOARCH=$(echo $TARGETPLATFORM | cut -f2 -d '/') make build | ||
|
||
FROM gcr.io/distroless/static:latest | ||
LABEL maintainers="Kubernetes Authors" | ||
LABEL description="CSI Node driver registrar" | ||
|
||
COPY --from=builder /code/bin/csi-node-driver-registrar csi-node-driver-registrar | ||
ENTRYPOINT ["/csi-node-driver-registrar"] |
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,28 @@ | ||
# See https://cloud.google.com/cloud-build/docs/build-config | ||
|
||
# this must be specified in seconds. If omitted, defaults to 600s (10 mins) | ||
timeout: 1200s | ||
# this prevents errors if you don't use both _GIT_TAG and _PULL_BASE_REF, | ||
# or any new substitutions added in the future. | ||
options: | ||
substitution_option: ALLOW_LOOSE | ||
steps: | ||
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4' | ||
entrypoint: 'bash' | ||
env: | ||
- DOCKER_CLI_EXPERIMENTAL=enabled | ||
- VERSION=$_GIT_TAG | ||
- BASE_REF=$_PULL_BASE_REF | ||
args: | ||
- '-c' | ||
- | | ||
docker buildx create --use --name multiarchimage-builder \ | ||
&& docker buildx build --push -t gcr.io/k8s-staging-csi/csi-node-driver-registrar:latest --platform=linux/amd64,linux/s390x -f Dockerfile.multiarch . | ||
substitutions: | ||
# _GIT_TAG will be filled with a git-based tag for the image, of the form vYYYYMMDD-hash, and | ||
# can be used as a substitution | ||
_GIT_TAG: '12345' | ||
# _PULL_BASE_REF will contain the ref that was pushed to to trigger this build - | ||
# a branch like 'master' or 'release-0.2', or a tag like 'v0.2'. | ||
_PULL_BASE_REF: 'master' | ||
|
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.
A link to https://github.com/kubernetes/test-infra/blob/master/config/jobs/image-pushing/README.md would be useful, because that is where it is specified how this works in Kubernetes.
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.
updated the link.