diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml deleted file mode 100644 index 13330b13c..000000000 --- a/.github/workflows/release.yaml +++ /dev/null @@ -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 . \ No newline at end of file diff --git a/deploy/Dockerfile b/deploy/Dockerfile index 3b5014531..341a1c131 100644 --- a/deploy/Dockerfile +++ b/deploy/Dockerfile @@ -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 && \ diff --git a/deploy/Dockerfile_debug b/deploy/Dockerfile_debug index 880b4e82d..132a01a2b 100644 --- a/deploy/Dockerfile_debug +++ b/deploy/Dockerfile_debug @@ -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 && \ diff --git a/deploy/Dockerfile_slim b/deploy/Dockerfile_slim index cdd1ad00e..919578c0a 100644 --- a/deploy/Dockerfile_slim +++ b/deploy/Dockerfile_slim @@ -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 diff --git a/deploy/Dockerfile_warmer b/deploy/Dockerfile_warmer index 8b542ca4f..9e349f83b 100644 --- a/deploy/Dockerfile_warmer +++ b/deploy/Dockerfile_warmer @@ -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 && \