forked from sameersbn/docker-squid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (24 loc) · 896 Bytes
/
Dockerfile
File metadata and controls
30 lines (24 loc) · 896 Bytes
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
# syntax=docker/dockerfile:1
ARG BASE_IMAGE=debian:12-slim
FROM --platform=$TARGETPLATFORM $BASE_IMAGE
LABEL maintainer="Aðalsteinn Rúnarsson <alli@allir.io>"
ARG SQUID_VERSION=5.7
ENV SQUID_VERSION=$SQUID_VERSION \
SQUID_CONFIG=/etc/squid/squid.conf \
SQUID_CACHE_DIR=/var/spool/squid \
SQUID_USER=proxy \
SQUID_CERT_DB_GENERATE=true \
SQUID_CERT_DB_SIZE=4MB
RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get -q install --no-install-recommends -y \
squid-openssl=${SQUID_VERSION}* \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN sed '/^#http_access allow localnet/s/^#//' -i /etc/squid/squid.conf \
&& mkdir -p /var/run/squid \
&& chown -R ${SQUID_USER}:${SQUID_USER} /var/run/squid
COPY conf.d/ /etc/squid/conf.d/
COPY entrypoint.sh /usr/sbin/entrypoint.sh
EXPOSE 3128/tcp
USER ${SQUID_USER}
ENTRYPOINT ["/usr/sbin/entrypoint.sh"]