Add avahi process, log squid3 to stdout.
This commit is contained in:
parent
94dec89581
commit
e18e5fb95c
17
Dockerfile
17
Dockerfile
|
@ -2,19 +2,21 @@ FROM ubuntu:trusty
|
||||||
MAINTAINER Panagiotis Moustafellos <pmoust@gmail.com>
|
MAINTAINER Panagiotis Moustafellos <pmoust@gmail.com>
|
||||||
|
|
||||||
# update and install squid-deb-proxy
|
# update and install squid-deb-proxy
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get -y upgrade && \
|
apt-get install -y --no-install-recommends \
|
||||||
apt-get install -y squid-deb-proxy squid-deb-proxy-client
|
squid-deb-proxy squid-deb-proxy-client avahi-daemon avahi-utils
|
||||||
|
|
||||||
# Extra locations to cache from
|
# Extra locations to cache from
|
||||||
ADD extra-sources.acl /etc/squid-deb-proxy/mirror-dstdomain.acl.d/20-extra-sources.acl
|
ADD extra-sources.acl /etc/squid-deb-proxy/mirror-dstdomain.acl.d/20-extra-sources.acl
|
||||||
|
|
||||||
# Point cache directory to /cachedir (80GB volume) and remove logging
|
# Point cache directory to /cachedir
|
||||||
RUN sed -ri 's/cache_dir aufs \/var\/cache\/squid-deb-proxy 40000 16 256/cache_dir aufs \/cachedir 8000 16 256/' /etc/squid-deb-proxy/squid-deb-proxy.conf && \
|
RUN ln -sf /cachedir /var/cache/squid-deb-proxy
|
||||||
sed -i '/^cache_access_log/d' /etc/squid-deb-proxy/squid-deb-proxy.conf && \
|
|
||||||
sed -i '/^cache_log/d' /etc/squid-deb-proxy/squid-deb-proxy.conf && \
|
|
||||||
sed -i '/^cache_store_log/d' /etc/squid-deb-proxy/squid-deb-proxy.conf;
|
|
||||||
|
|
||||||
|
# Redirect logs to stdout for the container
|
||||||
|
RUN ln -sf /dev/stdout /var/log/squid-deb-proxy/access.log
|
||||||
|
RUN ln -sf /dev/stdout /var/log/squid-deb-proxy/store.log
|
||||||
|
RUN ln -sf /dev/stdout /var/log/squid-deb-proxy/cache.log
|
||||||
|
|
||||||
ADD start.sh /start.sh
|
ADD start.sh /start.sh
|
||||||
RUN chmod +x /start.sh
|
RUN chmod +x /start.sh
|
||||||
|
@ -22,5 +24,6 @@ RUN chmod +x /start.sh
|
||||||
VOLUME ["/cachedir"]
|
VOLUME ["/cachedir"]
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
EXPOSE 5353/udp
|
||||||
|
|
||||||
ENTRYPOINT ["/start.sh"]
|
ENTRYPOINT ["/start.sh"]
|
||||||
|
|
8
start.sh
8
start.sh
|
@ -1,5 +1,13 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Advertise the availability of the cache.
|
||||||
|
avahi-daemon -D
|
||||||
|
|
||||||
|
# Necessary because squid forks itself to an unprivileged process.
|
||||||
chown -R proxy.proxy /cachedir
|
chown -R proxy.proxy /cachedir
|
||||||
|
chown proxy.proxy /dev/stdout
|
||||||
|
|
||||||
. /usr/share/squid-deb-proxy/init-common.sh
|
. /usr/share/squid-deb-proxy/init-common.sh
|
||||||
pre_start
|
pre_start
|
||||||
|
post_start
|
||||||
/usr/sbin/squid3 -N -f /etc/squid-deb-proxy/squid-deb-proxy.conf
|
/usr/sbin/squid3 -N -f /etc/squid-deb-proxy/squid-deb-proxy.conf
|
||||||
|
|
Loading…
Reference in New Issue