squid/docker/Dockerfile

25 lines
934 B
Docker
Raw Normal View History

2020-08-04 19:48:14 +00:00
FROM debian:8
RUN apt-get -y update
RUN apt-get install -y curl supervisor git openssl build-essential libssl-dev wget vim curl
RUN mkdir -p /var/log/supervisor
WORKDIR /apps/
2020-08-06 09:28:48 +00:00
RUN wget -O - http://www.squid-cache.org/Versions/v4/squid-4.12.tar.gz.asc | tar zxfv - \
2020-08-04 19:48:14 +00:00
&& CPU=$(( `nproc --all`-1 )) \
2020-08-06 09:28:48 +00:00
&& cd /apps/squid-4.12/ \
2020-08-04 19:48:14 +00:00
&& ./configure --prefix=/apps/squid --enable-icap-client --enable-ssl --with-openssl --enable-ssl-crtd --enable-auth --enable-basic-auth-helpers="NCSA" \
&& make -j$CPU \
&& make install \
&& cd /apps \
2020-08-06 09:28:48 +00:00
&& rm -rf /apps/squid-4.12
2020-08-04 19:48:14 +00:00
ADD . /apps/
RUN chown -R nobody:nogroup /apps/
RUN mkdir -p /apps/squid/var/lib/
RUN /apps/squid/libexec/ssl_crtd -c -s /apps/squid/var/lib/ssl_db -M 4MB
2020-08-05 07:30:16 +00:00
RUN /apps/squid/sbin/squid -N -f /apps/squid.cache.conf -z
2020-08-04 19:48:14 +00:00
RUN chown -R nobody:nogroup /apps/
EXPOSE 3128
ENTRYPOINT ["/apps/squid/sbin/squid", "-NsY", "-f"]
2020-08-04 20:02:21 +00:00
CMD ["/apps/squid.intercept.conf"]