@@ -2,8 +2,11 @@ FROM ubuntu:14.04
2
2
3
3
MAINTAINER Alex Fraser <alex@vpac-innovations.com.au>
4
4
5
+ # Install base dependencies.
5
6
# Run a caching proxy on the host and bind a port to APT_PROXY_PORT to cache
6
7
# apt requests. Build with `docker build --build-arg APT_PROXY_PORT=[X] [...]`.
8
+ # Not required if you're using a transparent proxy (like the one built by
9
+ # this project).
7
10
WORKDIR /root
8
11
ARG APT_PROXY_PORT=
9
12
COPY detect-apt-proxy.sh /root/
@@ -24,25 +27,26 @@ RUN export DEBIAN_FRONTEND=noninteractive TERM=linux \
24
27
# rm -rf /var/lib/apt/lists/* \
25
28
# /etc/apt/apt.conf.d/30proxy \
26
29
30
+ # Customise and build Squid.
27
31
# It's silly, but run dpkg-buildpackage again if it fails the first time. This
28
32
# is needed because sometimes the `configure` script is busy when building in
29
33
# Docker after autoconf sets its mode +x.
30
- COPY squid3.patch /root/
34
+ COPY squid3.patch mime.conf /root/
31
35
RUN cd squid3-3.?.? \
32
36
&& patch -p1 < /root/squid3.patch \
33
37
&& export NUM_PROCS=`grep -c ^processor /proc/cpuinfo` \
34
- && (dpkg-buildpackage -b -j${NUM_PROCS} || dpkg-buildpackage -b -j${NUM_PROCS})
35
- COPY mime.conf /root/
36
- RUN dpkg -i \
37
- squid3-common_3.?.?-?ubuntu?.?_all.deb \
38
- squid3_3.?.?-?ubuntu?.?_*.deb \
38
+ && (dpkg-buildpackage -b -j${NUM_PROCS} \
39
+ || dpkg-buildpackage -b -j${NUM_PROCS}) \
40
+ && DEBIAN_FRONTEND=noninteractive TERM=linux dpkg -i \
41
+ ../ squid3-common_3.?.?-?ubuntu?.?_all.deb \
42
+ ../ squid3_3.?.?-?ubuntu?.?_*.deb \
39
43
&& mkdir -p /etc/squid3/ssl_cert \
40
- && cat mime.conf >> /usr/share/squid3/mime.conf
44
+ && cat /root/ mime.conf >> /usr/share/squid3/mime.conf
41
45
42
46
COPY squid.conf /etc/squid3/squid.conf
43
47
COPY start_squid.sh /usr/local/bin/start_squid.sh
44
48
45
- VOLUME /var/spool/squid3
49
+ VOLUME /var/spool/squid3 /etc/squid3/ssl_cert
46
50
EXPOSE 3128 3129 3130
47
51
48
52
CMD ["/usr/local/bin/start_squid.sh" ]
0 commit comments