23 lines
668 B
Docker
23 lines
668 B
Docker
FROM docker.io/library/golang:1.19-alpine3.16 as builder
|
|
|
|
# hadolint ignore=DL3018
|
|
RUN apk add --no-cache build-base && \
|
|
go install -ldflags "-s -w" -trimpath git.worn.eu/guru/squid-rewriter@latest
|
|
|
|
#############################################################################
|
|
|
|
FROM docker.io/library/alpine:3.16
|
|
|
|
# hadolint ignore=DL3018
|
|
RUN apk add --no-cache squid openssl darkhttpd netcat-openbsd
|
|
COPY run.sh /
|
|
COPY install-ca.sh /static/
|
|
COPY squid.conf rewrites.yaml /etc/squid/
|
|
COPY --from=builder /go/bin/squid-rewriter /usr/local/bin/
|
|
RUN chmod 0755 /run.sh /usr/local/bin/squid-rewriter ; mkdir /ca
|
|
|
|
VOLUME /var/cache/squid
|
|
EXPOSE 3128
|
|
|
|
CMD ["/run.sh"]
|