Skip to content
This repository has been archived by the owner on Mar 14, 2023. It is now read-only.

Replace deprecated dep dependency with go mod #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 11 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# build stage
FROM golang:latest AS build-env
RUN go get github.com/golang/dep/cmd/dep
RUN go get -d github.com/GoogleCloudPlatform/k8s-node-termination-handler || true
WORKDIR /go/src/github.com/GoogleCloudPlatform/k8s-node-termination-handler

WORKDIR /build

COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -tags netgo -o node-termination-handler

# final stage
FROM gcr.io/distroless/static:latest
WORKDIR /app
COPY --from=build-env /go/src/github.com/GoogleCloudPlatform/k8s-node-termination-handler/node-termination-handler /app/
COPY --from=build-env /build/node-termination-handler /app/
ENTRYPOINT ["./node-termination-handler"]
15 changes: 11 additions & 4 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
# build stage
FROM golang:latest AS build-env
RUN go get github.com/golang/dep/cmd/dep
WORKDIR /go/src/github.com/GoogleCloudPlatform/k8s-node-termination-handler

WORKDIR /build

COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -tags netgo -o node-termination-handler && go test ./...

# final stage
FROM gcr.io/distroless/static:latest
WORKDIR /app
COPY --from=build-env /go/src/github.com/GoogleCloudPlatform/k8s-node-termination-handler/node-termination-handler /app/
ENTRYPOINT [./node-termination-handler]
COPY --from=build-env /build/node-termination-handler /app/
ENTRYPOINT ["./node-termination-handler"]
350 changes: 0 additions & 350 deletions Gopkg.lock

This file was deleted.

Loading