mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Update probetest container images to build binary and reduce final image size with multiple stages
This commit is contained in:
parent
ca07f57448
commit
14b8cde3da
2 changed files with 34 additions and 2 deletions
|
@ -1,3 +1,28 @@
|
|||
FROM golang:1.23
|
||||
FROM docker.io/library/golang:latest AS build
|
||||
|
||||
COPY probetest /go/bin
|
||||
|
||||
ADD . /app
|
||||
|
||||
WORKDIR /app/probetest
|
||||
RUN go get
|
||||
RUN CGO_ENABLED=0 go build -o probetest -ldflags '-extldflags "-static" -w -s' .
|
||||
|
||||
FROM containers.torproject.org/tpo/tpa/base-images/debian:bookworm as debian-base
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
gpg \
|
||||
gpg-agent \
|
||||
ca-certificates \
|
||||
libcap2-bin \
|
||||
--no-install-recommends
|
||||
|
||||
FROM scratch
|
||||
|
||||
COPY --from=debian-base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||
COPY --from=debian-base /usr/share/zoneinfo /usr/share/zoneinfo
|
||||
COPY --from=build /app/probetest/probetest /bin/probetest
|
||||
|
||||
ENTRYPOINT [ "/bin/probetest" ]
|
||||
|
||||
LABEL org.opencontainers.image.authors="anti-censorship-team@lists.torproject.org"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue