2020-05-19 21:53:13 +02:00
|
|
|
FROM golang AS build
|
|
|
|
|
2021-06-09 15:15:32 +02:00
|
|
|
ARG GIT_DESC=undefined
|
|
|
|
|
2020-05-19 21:53:13 +02:00
|
|
|
WORKDIR /go/src/github.com/Snawoot/dumbproxy
|
|
|
|
COPY . .
|
2021-06-09 15:15:32 +02:00
|
|
|
RUN CGO_ENABLED=0 go build -a -tags netgo -ldflags '-s -w -extldflags "-static" -X main.version='"$GIT_DESC"
|
2020-05-19 21:53:13 +02:00
|
|
|
ADD https://curl.haxx.se/ca/cacert.pem /certs.crt
|
|
|
|
RUN chmod 0644 /certs.crt
|
|
|
|
|
|
|
|
FROM scratch AS arrange
|
|
|
|
COPY --from=build /go/src/github.com/Snawoot/dumbproxy/dumbproxy /
|
|
|
|
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
|
|
|
|
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=arrange / /
|
|
|
|
USER 9999:9999
|
|
|
|
EXPOSE 8080/tcp
|
|
|
|
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
|