-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (19 loc) · 753 Bytes
/
Dockerfile
File metadata and controls
32 lines (19 loc) · 753 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
29
30
#FROM golang:1.12.4 as builder
FROM registry.cn-hangzhou.aliyuncs.com/bamboo/golang:1.12.4 as builder
ARG DIR=$GOPATH/src/github.com/kubernetes-sigs/san-client
WORKDIR $DIR
RUN mkdir -p $DIR
COPY / $DIR
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.io
#RUN go mod tidy
#RUN go mod vendor
#ENV GO111MODULE=off
RUN go build -o main -ldflags '-s -w' -v $DIR/cmd/san-client-provisioner
FROM alpine:3.9
ARG APK_MIRROR=mirrors.aliyun.com
RUN sed -i "s/dl-cdn.alpinelinux.org/${APK_MIRROR}/g" /etc/apk/repositories
RUN apk add --no-cache libc6-compat
## DON'T modify above, as it's common for all Alpine based parent and docker caching layer will used
CMD ["./main"]
COPY --from=builder /go/src/github.com/kubernetes-sigs/san-client/main .