This commit is contained in:
arraykeys@gmail.com
2018-07-16 18:10:21 +08:00
parent af91921070
commit 3cf7788f34

View File

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