Skip to content

Commit

Permalink
Merge pull request #5242 from sbueringer/pr-improve-capd-docker-build…
Browse files Browse the repository at this point in the history
…-caching

🌱 CAPD: improve image build caching
  • Loading branch information
k8s-ci-robot authored Sep 15, 2021
2 parents 8de0995 + 926921f commit 4e87b5f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/infrastructure/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ FROM ${builder_image} as builder
ARG goproxy=https://proxy.golang.org
ENV GOPROXY=$goproxy

# Gets additional CAPD dependencies
WORKDIR /tmp

RUN curl -LO https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/bin/kubectl

WORKDIR /workspace
COPY go.mod go.mod
COPY go.sum go.sum
Expand Down Expand Up @@ -50,13 +57,6 @@ RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o /workspace/manager main.go

# Gets additional CAPD dependencies
WORKDIR /tmp

RUN curl -LO https://dl.k8s.io/release/v1.22.0/bin/linux/amd64/kubectl && \
chmod +x ./kubectl && \
mv ./kubectl /usr/bin/kubectl

# NOTE: CAPD can't use non-root because docker requires access to the docker socket
FROM gcr.io/distroless/static:latest

Expand Down

0 comments on commit 4e87b5f

Please sign in to comment.