2021-12-10 12:27:35 +01:00
|
|
|
##################################################### BUILD STAGE ######################################################
|
2021-12-09 18:48:44 +01:00
|
|
|
FROM golang:alpine AS build
|
|
|
|
|
2021-12-10 10:17:13 +01:00
|
|
|
ARG GOPROXY
|
|
|
|
ARG GODEBUG
|
|
|
|
|
2021-12-09 18:48:44 +01:00
|
|
|
RUN apk add --no-cache -U make git mercurial subversion
|
|
|
|
|
|
|
|
RUN git clone https://github.com/goproxyio/goproxy.git /src/goproxy && \
|
|
|
|
cd /src/goproxy && \
|
|
|
|
export CGO_ENABLED=0 && \
|
|
|
|
make
|
|
|
|
|
2021-12-10 12:27:35 +01:00
|
|
|
################################################## PRODUCTION STAGE ####################################################
|
2021-12-09 18:48:44 +01:00
|
|
|
FROM golang:alpine
|
|
|
|
|
|
|
|
ENV TINI_VERSION v0.19.0
|
|
|
|
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static-amd64 /usr/bin/tini
|
|
|
|
RUN chmod +x /usr/bin/tini
|
|
|
|
|
|
|
|
RUN apk add --no-cache -U git mercurial subversion
|
|
|
|
|
|
|
|
COPY --from=build /src/goproxy/bin/goproxy /goproxy
|
|
|
|
VOLUME "/go"
|
|
|
|
|
|
|
|
EXPOSE 8888
|
|
|
|
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
|
|
CMD ["/goproxy", "-listen", "0.0.0.0:8888"]
|