Skip to content

Instantly share code, notes, and snippets.

@w1ndy
Last active May 28, 2019 13:36
Show Gist options
  • Save w1ndy/05b2da204f86cb39068d96f7eae45fb0 to your computer and use it in GitHub Desktop.
Save w1ndy/05b2da204f86cb39068d96f7eae45fb0 to your computer and use it in GitHub Desktop.
privoxy-gfwlist
FROM alpine AS build
WORKDIR /
RUN echo 'https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/main' > /etc/apk/repositories \
&& echo 'https://mirrors.tuna.tsinghua.edu.cn/alpine/latest-stable/community' >> /etc/apk/repositories \
&& apk add bash ca-certificates curl perl \
&& curl -4sSkLO https://raw.github.com/zfl9/gfwlist2privoxy/master/gfwlist2privoxy \
&& bash gfwlist2privoxy 127.0.0.1:1080
FROM alpine
RUN apk --nocache add privoxy
COPY --from=build /gfwlist.action /etc/privoxy/
RUN echo 'actionsfile gfwlist.action' >> /etc/privoxy/config \
&& sed -i '/listen-address/d' /etc/privoxy/config \
&& echo 'listen-address 0.0.0.0:8118' >> /etc/privoxy/config
ENTRYPOINT ["privoxy"]
CMD ["--no-daemon", "/etc/privoxy/config"]
EXPOSE 8118
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment