diff --git a/.github/workflows/tools-releases.yml b/.github/workflows/tools-releases.yml index 4d2bc7e1f..3ef785006 100644 --- a/.github/workflows/tools-releases.yml +++ b/.github/workflows/tools-releases.yml @@ -47,6 +47,7 @@ jobs: with: context: . file: ./hack/tools/envtest/${{matrix.os}}/Dockerfile + platforms: "${{matrix.os}}/${{matrix.arch}}" build-args: | KUBERNETES_VERSION=v${{env.KUBERNETES_VERSION}} OS=${{matrix.os}} diff --git a/hack/tools/envtest/darwin/Dockerfile b/hack/tools/envtest/darwin/Dockerfile index 6705f7628..1520d14dc 100644 --- a/hack/tools/envtest/darwin/Dockerfile +++ b/hack/tools/envtest/darwin/Dockerfile @@ -19,7 +19,7 @@ # - kubectl (fetch) # - etcd (fetch) -FROM golang:1.21 as builder +FROM golang:1.21 --platform=local as builder # Version and platform args. ARG KUBERNETES_VERSION @@ -63,7 +63,7 @@ RUN tar -czvf /kubebuilder_${OS}_${ARCH}.tar.gz kubebuilder/ # Copy tarball to final image. ARG ARCH -FROM gcr.io/distroless/static:nonroot-${ARCH} +FROM gcr.io/distroless/static:nonroot # Platform args. ARG OS=darwin diff --git a/hack/tools/envtest/linux/Dockerfile b/hack/tools/envtest/linux/Dockerfile index 7769587ef..ee7296f7b 100644 --- a/hack/tools/envtest/linux/Dockerfile +++ b/hack/tools/envtest/linux/Dockerfile @@ -19,8 +19,7 @@ # - kubectl (fetch) # - etcd (fetch) -# no need for anything fancy -FROM alpine:3.19 as builder +FROM golang:1.21 --platform=local as builder # Version and platform args. ARG KUBERNETES_VERSION @@ -32,7 +31,8 @@ ARG ARCH ENV DEST=/usr/local/kubebuilder/bin/ # Install dependencies. -RUN apk add --no-cache curl && \ +RUN apt update && \ + apt install unzip rsync -y && \ mkdir -p $DEST # kube-apiserver diff --git a/hack/tools/envtest/windows/Dockerfile b/hack/tools/envtest/windows/Dockerfile index 760e05de4..69c9b8ace 100644 --- a/hack/tools/envtest/windows/Dockerfile +++ b/hack/tools/envtest/windows/Dockerfile @@ -19,7 +19,7 @@ # - kubectl (fetch) # - etcd (fetch) -FROM golang:1.21 as builder +FROM golang:1.21 --platform=local as builder # Version and platform args. ARG KUBERNETES_VERSION