Dockerfile 915 B

12345678910111213141516171819202122232425
  1. FROM docker.io/library/golang:1.22 AS build
  2. # Set some labels
  3. # io.containers.autoupdate label will instruct podman to reach out to the corres
  4. # corresponding registry to check if the image has been updated. If an image
  5. # must be updated, Podman pulls it down and restarts the systemd unit executing
  6. # the container. See podman-auto-update(1) for more details, or
  7. # https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html
  8. LABEL io.containers.autoupdate=registry
  9. LABEL org.opencontainers.image.authors="anti-censorship-team@lists.torproject.org"
  10. ADD . /app
  11. WORKDIR /app/proxy
  12. RUN go get
  13. RUN CGO_ENABLED=0 go build -o proxy -ldflags '-extldflags "-static" -w -s' .
  14. FROM scratch
  15. COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
  16. COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
  17. COPY --from=build /app/proxy/proxy /bin/proxy
  18. ENTRYPOINT [ "/bin/proxy" ]