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:
parent
6b0305b6e5
commit
cc0825b06d
13
Dockerfile
Normal file
13
Dockerfile
Normal 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
|
@ -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
15
docker-entrypoint.sh
Normal 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
|
Loading…
Reference in New Issue
Block a user