From 7fc5c30f60f1143bd6e596217af5ad3b3c3ffb0b Mon Sep 17 00:00:00 2001 From: "arraykeys@gmail.com" Date: Mon, 16 Jul 2018 15:54:55 +0800 Subject: [PATCH] fix docker file --- Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 91863f3..786de97 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ FROM golang:1.10.3-alpine as builder ARG GOPROXY_VERSION=master RUN apk update && apk upgrade && \ - apk add --no-cache git && cd /go/src/ && git clone https://github.com/snail007/goproxy && \ - cd goproxy && git checkout ${GOPROXY_VERSION} && \ - go get && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o proxy + apk add --no-cache git && \ + cd /go/src/ && \ + 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 -COPY --from=builder /go/src/goproxy/proxy / CMD /proxy ${OPTS}