mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 09:37:02 +02:00
reporduce issue
This commit is contained in:
@@ -1,48 +0,0 @@
|
||||
name: Build images on push to master
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
env:
|
||||
IMAGE_NAME: gcr.io/kaniko-project/executor
|
||||
HASH: $(git rev-parse --short "$GITHUB_SHA")
|
||||
BRANCH: ${GITHUB_REF##*/}
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Clone source code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- 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: google-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 -q auth configure-docker
|
||||
SHORT_SHA1=$(git rev-parse --short HEAD)
|
||||
PLATFORMS="linux/amd64,linux/ppc64le,linux/arm64"
|
||||
echo "Building and pushing version ${SHORT_SHA1} of image ${IMAGE_NAME}"
|
||||
docker buildx build --platform "${PLATFORMS}" -t "${IMAGE_NAME}:${SHORT_SHA1}-slim" -t "${IMAGE_NAME}:test-multi-slim" -f ./deploy/Dockerfile_slim \
|
||||
--push .
|
||||
+4
-3
@@ -25,15 +25,16 @@ ARG TARGETPLATFORM
|
||||
|
||||
#Capture ARCH has write to /goarch
|
||||
RUN [ ! "x" = "x$TARGETPLATFORM" ] && `echo $TARGETPLATFORM | awk '{split($0,a,"/"); print a[2]}' > /goarch` || echo "$GOARCH"
|
||||
RUN echo "i am running on $TARGETPLATFORM with Arch $GOARCH"
|
||||
|
||||
# Get GCR credential helper
|
||||
RUN GOARCH=$(cat /goarch) && CGO_ENABLED=0 && \
|
||||
RUN GOARCH=$(cat /goarch) && \
|
||||
(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 && \
|
||||
make deps OUT_DIR=/usr/local/bin && \
|
||||
go build -ldflags "-linkmode external -extldflags -static" -i -o /usr/local/bin/docker-credential-gcr main.go
|
||||
make deps OUT_DIR=/usr/local/bin && \
|
||||
CGO_ENABLED=0 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 && \
|
||||
|
||||
@@ -30,8 +30,12 @@ RUN cat /goarch
|
||||
WORKDIR /go/src/github.com/GoogleContainerTools/kaniko
|
||||
|
||||
# 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 && \
|
||||
make && cp bin/docker-credential-gcr /usr/local/bin/docker-credential-gcr
|
||||
|
||||
# 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 && \
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
# Builds the static Go image to execute in a Kubernetes job
|
||||
FROM golang:1.15 as build_env
|
||||
FROM golang:1.14 as build_env
|
||||
ARG GOARCH=amd64
|
||||
RUN echo $GOARCH > /goarch
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
# Builds the static Go image to execute in a Kubernetes job
|
||||
|
||||
FROM golang:1.15
|
||||
FROM golang:1.14
|
||||
ARG GOARCH=amd64
|
||||
WORKDIR /go/src/github.com/GoogleContainerTools/kaniko
|
||||
RUN echo $GOARCH > /goarch
|
||||
@@ -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 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 && \
|
||||
make deps OUT_DIR=/usr/local/bin && \
|
||||
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 && \
|
||||
|
||||
Reference in New Issue
Block a user