fix docker file

This commit is contained in:
arraykeys@gmail.com
2018-07-16 15:54:55 +08:00
parent c4a7f0fbb0
commit 7fc5c30f60

View File

@ -1,9 +1,13 @@
FROM golang:1.10.3-alpine as builder FROM golang:1.10.3-alpine as builder
ARG GOPROXY_VERSION=master ARG GOPROXY_VERSION=master
RUN apk update && apk upgrade && \ RUN apk update && apk upgrade && \
apk add --no-cache git && cd /go/src/ && git clone https://github.com/snail007/goproxy && \ apk add --no-cache git && \
cd goproxy && git checkout ${GOPROXY_VERSION} && \ cd /go/src/ && \
go get && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o proxy mkdir snail007 && \
cd snail007 && \
git clone https://github.com/snail007/goproxy.git && \
cd goproxy && \
git checkout ${GOPROXY_VERSION} && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -o /proxy
FROM alpine:3.7 FROM alpine:3.7
COPY --from=builder /go/src/goproxy/proxy /
CMD /proxy ${OPTS} CMD /proxy ${OPTS}