1
0
mirror of https://github.com/b4tman/docker-squid.git synced 2024-11-22 19:26:54 +00:00
docker-squid/Dockerfile

127 lines
3.3 KiB
Docker
Raw Normal View History

2017-07-03 11:07:35 +00:00
FROM b4tman/armhf-alpine-qemu:3.6
2017-02-08 07:07:59 +00:00
MAINTAINER b4tman <b4tm4n@mail.ru>
2017-06-06 16:35:06 +00:00
ENV SQUID_VER 3.5.26
2017-05-04 10:34:08 +00:00
ENV SQUID_SIG_KEY EA31CC5E9488E5168D2DCC5EB268E706FF5CF463
ENV SQUID_CONFIG_FILE /etc/squid/squid.conf
2017-05-04 08:09:20 +00:00
ENV TZ Europe/Moscow
2017-03-07 18:03:51 +00:00
RUN [ "cross-build-start" ]
2017-05-04 08:09:20 +00:00
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
2017-02-08 07:07:59 +00:00
2017-05-04 08:09:20 +00:00
RUN apk add --no-cache \
libstdc++ \
heimdal-libs \
libcap \
2017-07-04 06:53:55 +00:00
libressl2.5-libcrypto \
libressl2.5-libssl \
2017-05-04 08:09:20 +00:00
libltdl
2017-05-04 10:34:08 +00:00
RUN set -x && \
apk add --no-cache --virtual .build-deps \
2017-05-04 08:09:20 +00:00
gcc \
g++ \
libc-dev \
alpine-conf \
tzdata \
curl \
gnupg \
libressl-dev \
perl-dev \
autoconf \
automake \
make \
pkgconfig \
heimdal-dev \
libtool \
libcap-dev \
linux-headers ; \
2017-05-04 08:09:20 +00:00
\
mkdir -p /tmp/build && \
cd /tmp/build && \
2017-05-04 10:34:08 +00:00
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 && \
2017-05-04 08:09:20 +00:00
\
export GNUPGHOME="$(mktemp -d)" && \
2017-05-04 10:34:08 +00:00
gpg --keyserver ha.pool.sks-keyservers.net --recv-keys ${SQUID_SIG_KEY} && \
2017-05-04 08:09:20 +00:00
gpg --batch --verify squid-${SQUID_VER}.tar.gz.asc squid-${SQUID_VER}.tar.gz && \
\
tar --strip 1 -xzf squid-${SQUID_VER}.tar.gz && \
export CFLAGS="-g0 -O2" && \
export CXXFLAGS="$CFLAGS" && \
export LDFLAGS="-s" && \
./configure \
--build="$(uname -m)" \
--host="$(uname -m)" \
--prefix=/usr \
--datadir=/usr/share/squid \
--sysconfdir=/etc/squid \
--libexecdir=/usr/lib/squid \
--localstatedir=/var \
--with-logdir=/var/log/squid \
--disable-strict-error-checking \
--disable-arch-native \
--enable-removal-policies="lru,heap" \
--enable-auth-digest \
--enable-auth-basic="getpwnam,NCSA" \
--enable-epoll \
--enable-external-acl-helpers="file_userip,unix_group,wbinfo_group" \
--enable-auth-ntlm="fake" \
--enable-auth-negotiate="wrapper" \
--enable-silent-rules \
--disable-mit \
--enable-heimdal \
--enable-delay-pools \
--enable-arp-acl \
--enable-openssl \
--enable-ssl-crtd \
--enable-ident-lookups \
--enable-useragent-log \
--enable-cache-digests \
--enable-referer-log \
--enable-async-io \
--enable-truncate \
--enable-arp-acl \
--enable-htcp \
--enable-carp \
2017-05-04 10:34:08 +00:00
--enable-epoll \
2017-05-04 08:09:20 +00:00
--enable-follow-x-forwarded-for \
--enable-storeio="diskd rock" \
--enable-ipv6 \
--enable-translation \
--disable-snmp \
--disable-dependency-tracking \
--with-large-files \
--with-default-user=squid \
--with-openssl \
--with-pidfile=/var/run/squid/squid.pid \
make && \
make install && \
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 ; \
2017-05-04 08:09:20 +00:00
cd / && \
rm -rf /tmp/build "$GNUPGHOME"
2017-02-08 07:07:59 +00:00
2017-05-11 11:35:08 +00:00
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 [ "cross-build-end" ]
2017-02-08 07:07:59 +00:00
2017-02-08 07:42:55 +00:00
VOLUME ["/var/cache/squid"]
2017-02-08 07:07:59 +00:00
EXPOSE 3128/tcp
2017-02-08 07:42:55 +00:00
2017-05-04 08:09:20 +00:00
USER squid
CMD ["sh", "-c", "/usr/sbin/squid -f ${SQUID_CONFIG_FILE} -z && exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} -NYCd 1"]