From 2db849fddd1a2a1076b1c22d6845919890ea509f Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 6 Jun 2017 19:35:06 +0300 Subject: [PATCH 1/7] update to 3.5.26 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6fb3fce..fae4007 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.5 MAINTAINER b4tman -ENV SQUID_VER 3.5.25 +ENV SQUID_VER 3.5.26 ENV SQUID_SIG_KEY EA31CC5E9488E5168D2DCC5EB268E706FF5CF463 ENV SQUID_CONFIG_FILE /etc/squid/squid.conf ENV TZ Europe/Moscow From af98f18df4742d55a60f18daa1e078014dcdc242 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 3 Jul 2017 13:50:03 +0300 Subject: [PATCH 2/7] bump alpine to 3.6 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fae4007..4a62317 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.5 +FROM alpine:3.6 MAINTAINER b4tman ENV SQUID_VER 3.5.26 From b8af31657582095336c52ebaab1078ab090c9877 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Tue, 4 Jul 2017 09:53:55 +0300 Subject: [PATCH 3/7] bump libressl to 2.5 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a62317..ae27390 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,8 @@ RUN apk add --no-cache \ libstdc++ \ heimdal-libs \ libcap \ - libressl2.4-libcrypto \ - libressl2.4-libssl \ + libressl2.5-libcrypto \ + libressl2.5-libssl \ libltdl RUN set -x && \ From cbce834670e2711305926da3848484d56819db97 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 20 Sep 2017 11:25:44 +0300 Subject: [PATCH 4/7] bump squid to 3.5.27 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ae27390..240d9c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM alpine:3.6 MAINTAINER b4tman -ENV SQUID_VER 3.5.26 +ENV SQUID_VER 3.5.27 ENV SQUID_SIG_KEY EA31CC5E9488E5168D2DCC5EB268E706FF5CF463 ENV SQUID_CONFIG_FILE /etc/squid/squid.conf ENV TZ Europe/Moscow From e89dd2383a62e876c992d7e4101726ce3c8b94a2 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 20 Sep 2017 13:52:46 +0300 Subject: [PATCH 5/7] update README (cherry picked from commit 2c8641472ecff66110c73dbeed9e9a52609af9af) --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 5caadb3..cc4f388 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ Docker Squid container based on Alpine Linux. Automated builds of the image are available on [Dockerhub](https://hub.docker.com/r/b4tman/squid). -> **Note**: [armhf](https://github.com/b4tman/docker-squid/tree/armhf) image is based on **experimental** [armhf/alpine](https://hub.docker.com/r/armhf/alpine/) image. - # Quick Start Just launch container: From c7d9736e2e9918af06774a7bcc771a8c6dafc486 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 21 Sep 2017 10:50:41 +0300 Subject: [PATCH 6/7] parallel compile jobs (cherry picked from commit 27509b05f60b99641cfc1565e210a274c0d71f7b) --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 240d9c8..dbdba6b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,8 +95,8 @@ RUN set -x && \ --with-large-files \ --with-default-user=squid \ --with-openssl \ - --with-pidfile=/var/run/squid/squid.pid \ - make && \ + --with-pidfile=/var/run/squid/squid.pid && \ + make -j $(grep -cs ^processor /proc/cpuinfo) && \ make install && \ install -d -o squid -g squid \ /var/cache/squid \ From dcb8862e7525836d480b2a33187103b3043a8f9a Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 22 Sep 2017 14:41:21 +0300 Subject: [PATCH 7/7] multi-stage build --- Dockerfile | 93 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 38 deletions(-) diff --git a/Dockerfile b/Dockerfile index dbdba6b..63ac90a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,30 +1,13 @@ -FROM alpine:3.6 -MAINTAINER b4tman +FROM alpine:3.6 as build ENV SQUID_VER 3.5.27 ENV SQUID_SIG_KEY EA31CC5E9488E5168D2DCC5EB268E706FF5CF463 -ENV SQUID_CONFIG_FILE /etc/squid/squid.conf -ENV TZ Europe/Moscow RUN set -x && \ - deluser squid 2>/dev/null; delgroup squid 2>/dev/null; \ - addgroup -S squid -g 3128 && adduser -S -u 3128 -G squid -g squid -H -D -s /bin/false -h /var/cache/squid squid - -RUN apk add --no-cache \ - libstdc++ \ - heimdal-libs \ - libcap \ - libressl2.5-libcrypto \ - libressl2.5-libssl \ - libltdl - -RUN set -x && \ - apk add --no-cache --virtual .build-deps \ + apk add --no-cache \ gcc \ g++ \ libc-dev \ - alpine-conf \ - tzdata \ curl \ gnupg \ libressl-dev \ @@ -36,21 +19,29 @@ RUN set -x && \ heimdal-dev \ libtool \ libcap-dev \ - linux-headers && \ - \ + linux-headers + +RUN set -x && \ mkdir -p /tmp/build && \ cd /tmp/build && \ curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%.*.*}/${SQUID_VER%.*}/squid-${SQUID_VER}.tar.gz -o squid-${SQUID_VER}.tar.gz && \ - curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%.*.*}/${SQUID_VER%.*}/squid-${SQUID_VER}.tar.gz.asc -o squid-${SQUID_VER}.tar.gz.asc && \ - \ + curl -SsL http://www.squid-cache.org/Versions/v${SQUID_VER%.*.*}/${SQUID_VER%.*}/squid-${SQUID_VER}.tar.gz.asc -o squid-${SQUID_VER}.tar.gz.asc + +RUN set -x && \ + cd /tmp/build && \ export GNUPGHOME="$(mktemp -d)" && \ gpg --keyserver ha.pool.sks-keyservers.net --recv-keys ${SQUID_SIG_KEY} && \ gpg --batch --verify squid-${SQUID_VER}.tar.gz.asc squid-${SQUID_VER}.tar.gz && \ - \ + rm -rf "$GNUPGHOME" + +RUN set -x && \ + cd /tmp/build && \ tar --strip 1 -xzf squid-${SQUID_VER}.tar.gz && \ - export CFLAGS="-g0 -O2" && \ - export CXXFLAGS="$CFLAGS" && \ - export LDFLAGS="-s" && \ + \ + CFLAGS="-g0 -O2" \ + CXXFLAGS="-g0 -O2" \ + LDFLAGS="-s" \ + \ ./configure \ --build="$(uname -m)" \ --host="$(uname -m)" \ @@ -95,24 +86,50 @@ RUN set -x && \ --with-large-files \ --with-default-user=squid \ --with-openssl \ - --with-pidfile=/var/run/squid/squid.pid && \ + --with-pidfile=/var/run/squid/squid.pid + +RUN set -x && \ + cd /tmp/build && \ make -j $(grep -cs ^processor /proc/cpuinfo) && \ - make install && \ - install -d -o squid -g squid \ + make install + +FROM alpine:3.6 +MAINTAINER b4tman + +ENV SQUID_CONFIG_FILE /etc/squid/squid.conf +ENV TZ Europe/Moscow + +RUN set -x && \ + deluser squid 2>/dev/null; delgroup squid 2>/dev/null; \ + addgroup -S squid -g 3128 && adduser -S -u 3128 -G squid -g squid -H -D -s /bin/false -h /var/cache/squid squid + +RUN apk add --no-cache \ + libstdc++ \ + heimdal-libs \ + libcap \ + libressl2.5-libcrypto \ + libressl2.5-libssl \ + libltdl + +COPY --from=build /etc/squid/ /etc/squid/ +COPY --from=build /usr/lib/squid/ /usr/lib/squid/ +COPY --from=build /usr/share/squid/ /usr/share/squid/ +COPY --from=build /usr/sbin/squid /usr/sbin/squid + +RUN install -d -o squid -g squid \ /var/cache/squid \ /var/log/squid \ /var/run/squid && \ - chmod +x /usr/lib/squid/* &&\ - \ - /sbin/setup-timezone -z $TZ && \ - \ - apk del .build-deps && \ - cd / && \ - rm -rf /tmp/build "$GNUPGHOME" - + chmod +x /usr/lib/squid/* + RUN echo 'include /etc/squid/conf.d/*.conf' >> "$SQUID_CONFIG_FILE" && \ install -d -m 755 -o squid -g squid /etc/squid/conf.d COPY squid-log.conf /etc/squid/conf.d/ + +RUN set -x && \ + apk add --no-cache --virtual .tz alpine-conf tzdata && \ + /sbin/setup-timezone -z $TZ && \ + apk del .tz VOLUME ["/var/cache/squid"] EXPOSE 3128/tcp