Skip to content

Commit

Permalink
Add s390x support to docker images
Browse files Browse the repository at this point in the history
1. add s390x support to docker images `executor`, `executor(slim)`,
   `executor(debug)` and `warmer`. Fixes GoogleContainerTools#1462 and GoogleContainerTools#1665.

2. Address the building issue of dependency `docker-credential-gcr`
   in Dockerfiles. This issue was introduced when recent commits
   in `docker-credential-gcr` removed the Makefile.

Signed-off-by: Kun-Lu <kun.lu@ibm.com>
  • Loading branch information
kun-lu20 committed Sep 23, 2021
1 parent 7e3954a commit 8d98aaf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
PLATFORMS: "linux/amd64,linux/arm64,linux/ppc64le"
PLATFORMS: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
runs-on: ubuntu-latest
steps:
- name: Clone source code
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
with:
context: .
file: ./deploy/Dockerfile_slim
platforms: linux/amd64,linux/arm64,linux/ppc64le
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: |
gcr.io/kaniko-project/executor:${{ env.GITHUB_SHA }}-slim
Expand All @@ -67,7 +67,7 @@ jobs:
with:
context: .
file: ./deploy/Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: |
gcr.io/kaniko-project/executor:${{ env.GITHUB_SHA }}
Expand All @@ -94,7 +94,7 @@ jobs:
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
PLATFORMS: "linux/amd64,linux/arm64,linux/ppc64le"
PLATFORMS: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
runs-on: ubuntu-latest
steps:
- name: Clone source code
Expand Down Expand Up @@ -140,7 +140,7 @@ jobs:
with:
context: .
file: ./deploy/Dockerfile_debug
platforms: linux/amd64,linux/arm64,linux/ppc64le
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: |
gcr.io/kaniko-project/executor:${{ env.GITHUB_SHA }}-debug
Expand All @@ -163,7 +163,7 @@ jobs:
env:
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
PLATFORMS: "linux/amd64,linux/arm64,linux/ppc64le"
PLATFORMS: "linux/amd64,linux/arm64,linux/ppc64le,linux/s390x"
runs-on: ubuntu-latest
steps:
- name: Clone source code
Expand Down Expand Up @@ -208,7 +208,7 @@ jobs:
with:
context: .
file: ./deploy/Dockerfile_warmer
platforms: linux/amd64,linux/arm64,linux/ppc64le
platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
push: true
tags: |
gcr.io/kaniko-project/warmer:${{ env.GITHUB_SHA }}
Expand Down
4 changes: 2 additions & 2 deletions deploy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN GOARCH=$(cat /goarch) && CGO_ENABLED=0 && \
cd /go/src/github.com/GoogleCloudPlatform && \
git clone https://github.com/GoogleCloudPlatform/docker-credential-gcr.git && \
cd /go/src/github.com/GoogleCloudPlatform/docker-credential-gcr && \
make deps OUT_DIR=/usr/local/bin && \
go get -u -t ./... && \
go build -ldflags "-linkmode external -extldflags -static" -i -o /usr/local/bin/docker-credential-gcr main.go

# Get Amazon ECR credential helper
Expand All @@ -50,7 +50,7 @@ RUN GOARCH=$(cat /goarch) && (mkdir -p /go/src/github.com/chrismellard || true)
RUN mkdir -p /kaniko/.docker

COPY . .
RUN make GOARCH=$(cat /goarch.txt)
RUN make GOARCH=$(cat /goarch)

# Generate latest ca-certificates

Expand Down
11 changes: 8 additions & 3 deletions deploy/Dockerfile_debug
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ RUN cat /goarch


# Get GCR credential helper
ADD https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.0.1/docker-credential-gcr_linux_$GOARCH-2.0.1.tar.gz /usr/local/bin/
RUN tar --no-same-owner -C /usr/local/bin/ -xvzf /usr/local/bin/docker-credential-gcr_linux_$GOARCH-2.0.1.tar.gz
RUN GOARCH=$(cat /goarch) && CGO_ENABLED=0 && \
(mkdir -p /go/src/github.com/GoogleCloudPlatform || true) && \
cd /go/src/github.com/GoogleCloudPlatform && \
git clone https://github.com/GoogleCloudPlatform/docker-credential-gcr.git && \
cd /go/src/github.com/GoogleCloudPlatform/docker-credential-gcr && \
go get -u -t ./... && \
go build -ldflags "-linkmode external -extldflags -static" -i -o /usr/local/bin/docker-credential-gcr main.go

# Get Amazon ECR credential helper
RUN GOARCH=$(cat /goarch) && go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login && \
Expand All @@ -48,7 +53,7 @@ RUN GOARCH=$(cat /goarch) && (mkdir -p /go/src/github.com/chrismellard || true)
RUN mkdir -p /kaniko/.docker

COPY . .
RUN make GOARCH=$(cat /goarch) && make GOARCH=$(cat /goarch.txt) out/warmer
RUN make GOARCH=$(cat /goarch) && make GOARCH=$(cat /goarch) out/warmer

# Generate latest ca-certificates

Expand Down
9 changes: 7 additions & 2 deletions deploy/Dockerfile_warmer
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ RUN [ ! "x" = "x$TARGETPLATFORM" ] && `echo $TARGETPLATFORM | awk '{split($0,a,
RUN echo "I am runninng $TARGETPLATFORM with $(cat /goarch)"

# Get GCR credential helper
ADD https://github.com/GoogleCloudPlatform/docker-credential-gcr/releases/download/v2.0.1/docker-credential-gcr_linux_$GOARCH-2.0.1.tar.gz /usr/local/bin/
RUN tar --no-same-owner -C /usr/local/bin/ -xvzf /usr/local/bin/docker-credential-gcr_linux_$GOARCH-2.0.1.tar.gz
RUN GOARCH=$(cat /goarch) && CGO_ENABLED=0 && \
(mkdir -p /go/src/github.com/GoogleCloudPlatform || true) && \
cd /go/src/github.com/GoogleCloudPlatform && \
git clone https://github.com/GoogleCloudPlatform/docker-credential-gcr.git && \
cd /go/src/github.com/GoogleCloudPlatform/docker-credential-gcr && \
go get -u -t ./... && \
go build -ldflags "-linkmode external -extldflags -static" -i -o /usr/local/bin/docker-credential-gcr main.go

# Get Amazon ECR credential helper
RUN GOARCH=$(cat /goarch) && go get -u github.com/awslabs/amazon-ecr-credential-helper/ecr-login/cli/docker-credential-ecr-login && \
Expand Down
1 change: 1 addition & 0 deletions hack/install_golint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ is_supported_platform() {
linux/amd64) found=0 ;;
linux/386) found=0 ;;
linux/ppc64le) found=0 ;;
linux/s390x) found=0 ;;
esac
return $found
}
Expand Down

0 comments on commit 8d98aaf

Please sign in to comment.