-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
116 lines (102 loc) · 3.82 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
FROM --platform=$BUILDPLATFORM debian:bookworm AS builder
ARG DEBIAN_FRONTEND=noninteractive
ENV SOURCEURL=https://www.squid-cache.org/Versions/v6/squid-6.12.tar.gz
ENV LANGPACKURL=https://www.squid-cache.org/Versions/langpack/squid-langpack-20240307.tar.gz
ENV builddeps=" \
build-essential \
checkinstall \
curl \
devscripts \
libcrypto++-dev \
libssl-dev \
openssl \
"
ENV requires=" \
libatomic1, \
libc6, \
libcap2, \
libdb5.3, \
libdbi-perl, \
libecap3, \
libexpat1, \
libgnutls30, \
libgssapi-krb5-2, \
libkrb5-3, \
libldap-2.5-0, \
libltdl7, \
libnetfilter-conntrack3, \
libnettle8, \
libpam0g, \
libsasl2-2, \
libstdc++6, \
libxml2, \
netbase, \
openssl \
"
RUN echo "deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm main" > /etc/apt/sources.list.d/source.list \
&& echo "deb-src [signed-by=/usr/share/keyrings/debian-archive-keyring.gpg] http://deb.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list.d/source.list \
&& apt-get -qy update \
&& apt-get -qy install ${builddeps} \
&& apt-get -qy build-dep squid \
&& mkdir /build
WORKDIR /build
RUN curl -o /build/squid-source.tar.gz ${SOURCEURL} \
&& curl -o /build/squid-langpack.tar.gz ${LANGPACKURL} \
&& tar --strip=1 -xf squid-source.tar.gz
RUN ./configure --prefix=/usr \
--with-build-environment=default \
--localstatedir=/var \
--libexecdir=/usr/lib/squid \
--datadir=/usr/share/squid \
--sysconfdir=/etc/squid \
--with-default-user=proxy \
--with-logdir=/var/log/squid \
--with-pidfile=/run/squid.pid \
--mandir=/usr/share/man \
--enable-inline \
--disable-arch-native \
--enable-async-io=8 \
--enable-storeio="ufs,aufs,diskd,rock" \
--enable-removal-policies="lru,heap" \
--enable-delay-pools \
--enable-cache-digests \
--enable-icap-client \
--enable-follow-x-forwarded-for \
--enable-auth-basic="DB,fake,getpwnam,LDAP,NCSA,PAM,POP3,RADIUS,SASL,SMB" \
--enable-auth-digest="file,LDAP" \
--enable-auth-negotiate="kerberos,wrapper" \
--enable-auth-ntlm="fake,SMB_LM" \
--enable-external-acl-helpers="file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,time_quota,unix_group,wbinfo_group" \
--enable-security-cert-validators="fake" \
--enable-storeid-rewrite-helpers="file" \
--enable-url-rewrite-helpers="fake" \
--enable-eui \
--enable-esi \
--enable-icmp \
--enable-zph-qos \
--enable-ecap \
--disable-translation \
--with-swapdir=/var/spool/squid \
--with-filedescriptors=65536 \
--with-large-files \
--enable-linux-netfilter \
--enable-ssl --enable-ssl-crtd --with-openssl \
&& make -j$(awk '/^processor/{n+=1}END{print n}' /proc/cpuinfo) \
&& checkinstall -y -D --install=no --fstrans=no --requires="${requires}" \
--pkgname="squid"
FROM --platform=$BUILDPLATFORM debian:bookworm-slim
ARG DEBIAN_FRONTEND=noninteractive
COPY --from=builder /build/squid_0-1_amd64.deb /tmp/squid.deb
RUN apt update \
&& apt -qy install libssl3 /tmp/squid.deb \
&& rm -rf /var/lib/apt/lists/*
# Install language pack
COPY --from=builder /build/squid-langpack.tar.gz /tmp/squid-langpack.tar.gz
RUN cd /usr/share/squid/errors \
&& tar -xf /tmp/squid-langpack.tar.gz \
&& rm -rf /tmp/squid-langpack.tar.gz \
&& /usr/share/squid/errors/alias-link.sh /bin/ln /bin/rm /usr/share/squid/errors /usr/share/squid/errors/aliases
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["squid", "-NYC", "-f", "/conf/squid.conf"]