1
0
mirror of https://github.com/b4tman/docker-squid.git synced 2024-12-22 09:03:13 +00:00

squid container

This commit is contained in:
Dmitry Belyaev 2017-02-08 10:07:59 +03:00
parent 6b0305b6e5
commit cc0825b06d
3 changed files with 31 additions and 1 deletions

13
Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM alpine
MAINTAINER b4tman <b4tm4n@mail.ru>
ENV SQUID_CONFIG_FILE=/etc/squid/squid.conf
RUN apk add --no-cache squid
VOLUME ["/var/cache/squid"]
COPY docker-entrypoint.sh /
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["squid"]
EXPOSE 3128/tcp

View File

@ -1,2 +1,4 @@
# docker-squid
ocker Squid container based on Alpine
Docker Squid container based on Alpine Linux

15
docker-entrypoint.sh Normal file
View File

@ -0,0 +1,15 @@
#!/bin/sh
set -e
if [ "$1" = 'squid' ]; then
mkdir -p /var/log/squid
mkdir -p /var/cache/squid
if [ ! "$(ls -A /var/cache/squid)" ]; then
/usr/sbin/squid -f ${SQUID_CONFIG_FILE} -z
fi
exec /usr/sbin/squid -f ${SQUID_CONFIG_FILE} -NYCd 1
else
exec "$@"
fi