Dockerfile 1.0 KB

12345678910111213141516171819202122232425262728
  1. FROM docker.io/library/golang:1.23-bookworm 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. RUN apt-get update && apt-get install -y tor-geoipdb
  11. ADD . /app
  12. WORKDIR /app/proxy
  13. RUN go get
  14. RUN CGO_ENABLED=0 go build -o proxy -ldflags '-extldflags "-static" -w -s' .
  15. FROM scratch
  16. COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
  17. COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo
  18. COPY --from=build /usr/share/tor/geoip* /usr/share/tor/
  19. COPY --from=build /app/proxy/proxy /bin/proxy
  20. ENTRYPOINT [ "/bin/proxy" ]