-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
45 lines (37 loc) · 1.27 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Author: Satish Gaikwad <[email protected]>
FROM alpine:latest
LABEL MAINTAINER [email protected]
ARG SQUID_VERSION 5.9-r0
ARG SQUID_PROXY_PORT 3128
ARG SQUID_PROXY_SSLBUMP_PORT 4128
#set enviromental values for certificate CA generation
ENV CERT_CN=squid.local \
CERT_ORG=squid \
CERT_OU=squid \
CERT_COUNTRY=US \
SQUID_PROXY_PORT=3128 \
SQUID_PROXY_SSLBUMP_PORT=4128
# Add squid and other packages
RUN apk add --no-cache \
squid=${SQUID_VERSION} \
openssl \
gettext \
ca-certificates && \
update-ca-certificates && \
rm -rf /etc/squid/squid.conf
# Add config file
ADD conf/squid.sample.conf /templates/squid.sample.conf
ADD conf/openssl.extra.cnf /etc/ssl
# Add scripts and make them executable
ADD scripts/entrypoint.sh /entrypoint
RUN chmod u+x /entrypoint && \
mkdir -p /etc/squid-cert /var/cache/squid/ /var/log/squid/ && \
chown -R squid:squid /etc/squid-cert /var/cache/squid/ /var/log/squid/ && \
cat /etc/ssl/openssl.extra.cnf >> /etc/ssl/openssl.cnf
EXPOSE 3128
EXPOSE 4128
# Healthcheck
HEALTHCHECK CMD netstat -an | grep ${SQUID_PROXY_PORT} > /dev/null; if [ 0 != $? ]; then exit 1; fi;
# Run the command on container startup
ENTRYPOINT ["/entrypoint"]
CMD ["squid", "-NYCd", "1", "-f", "/etc/squid/squid.conf"]