-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (21 loc) · 804 Bytes
/
Dockerfile
File metadata and controls
28 lines (21 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Build the manager binary
FROM golang:1.12 as builder
ARG VERSION=undefined
# Install Dep
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
# Copy in the go src
WORKDIR /go/src/github.com/pusher/navarchos
COPY Gopkg.lock Gopkg.lock
COPY Gopkg.toml Gopkg.toml
# Fetch dependencies before copying code (should cache unless Gopkg's change)
RUN dep ensure --vendor-only
COPY pkg/ pkg/
COPY cmd/ cmd/
# Build
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o navarchos -ldflags="-X main.VERSION=${VERSION}" github.com/pusher/navarchos/cmd/manager
# Copy the controller-manager into a thin image
FROM alpine:3.9
RUN apk --no-cache add ca-certificates
WORKDIR /bin
COPY --from=builder /go/src/github.com/pusher/navarchos/navarchos .
ENTRYPOINT ["/bin/navarchos"]