Skip to content

Commit

Permalink
fix docker layer caching (#489)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwagner5 authored Sep 2, 2021
1 parent bf732a6 commit 4a6f453
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Build the manager binary
FROM golang:1.16 as builder

## GOLANG env
ARG GOPROXY="https://proxy.golang.org|direct"
ARG GO111MODULE="on"
ARG CGO_ENABLED=0
ARG GOOS=linux
ARG GOARCH=amd64

# Copy go.mod and download dependencies
WORKDIR /node-termination-handler
COPY go.mod .
COPY go.sum .
RUN go mod download

ARG CGO_ENABLED=0
ARG GOOS=linux
ARG GOARCH=amd64

# Build
COPY . .
RUN make build
# In case the target is build for testing:
# $ docker build --target=builder -t test .
# $ docker build --target=builder -t test .
ENTRYPOINT ["/node-termination-handler/build/node-termination-handler"]

# Copy the controller-manager into a thin image
# Build the final image with only the binary
FROM amazonlinux:2 as amazonlinux
FROM scratch
WORKDIR /
Expand Down

0 comments on commit 4a6f453

Please sign in to comment.