astraproxy/Dockerfile

29 lines
1023 B
Docker
Raw Permalink Normal View History

2023-09-30 14:34:16 +02:00
FROM --platform=$BUILDPLATFORM golang AS build
2020-05-19 21:53:13 +02:00
2021-06-09 15:15:32 +02:00
ARG GIT_DESC=undefined
2024-01-28 21:56:59 +01:00
WORKDIR /go/src/github.com/SenseUnit/dumbproxy
2020-05-19 21:53:13 +02:00
COPY . .
2023-09-30 14:52:42 +02:00
ARG TARGETOS TARGETARCH
2023-09-30 14:34:16 +02:00
RUN GOOS=$TARGETOS GOARCH=$TARGETARCH 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
RUN mkdir /.dumbproxy
2020-05-19 21:53:13 +02:00
FROM scratch AS scratch
2024-01-28 21:56:59 +01:00
COPY --from=build /go/src/github.com/SenseUnit/dumbproxy/dumbproxy /
2020-05-19 21:53:13 +02:00
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build --chown=9999:9999 /.dumbproxy /.dumbproxy
USER 9999:9999
EXPOSE 8080/tcp
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]
2020-05-19 21:53:13 +02:00
FROM alpine AS alpine
2024-01-28 21:56:59 +01:00
COPY --from=build /go/src/github.com/SenseUnit/dumbproxy/dumbproxy /
COPY --from=build /certs.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build --chown=9999:9999 /.dumbproxy /.dumbproxy
2024-02-20 09:43:28 +01:00
RUN apk add --no-cache tzdata
2020-05-19 21:53:13 +02:00
USER 9999:9999
EXPOSE 8080/tcp
ENTRYPOINT ["/dumbproxy", "-bind-address", ":8080"]