forked from uswitch/kiam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
24 lines (20 loc) · 678 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM golang:1.15.15 as build
ENV GO111MODULE=on
WORKDIR /workspace
# Copy the Go Modules manifests
COPY go.mod go.mod
COPY go.sum go.sum
# cache deps before building and copying source so that we don't need to re-download as much
# and so that source changes don't invalidate our downloaded layer
RUN go mod download
COPY cmd/ cmd/
COPY pkg/ pkg/
COPY proto/ proto/
COPY Makefile Makefile
# As (generated) proto/service.pb.go is _also_ committed, void the need to install protoc / protoc-gen-go plugin
RUN touch proto/service.pb.go
RUN make bin/kiam-linux-amd64
FROM alpine:3.11
RUN apk --no-cache add iptables
COPY --from=build /workspace/bin/kiam-linux-amd64 /kiam
CMD []