-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
31 lines (22 loc) · 844 Bytes
/
Dockerfile
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
31
FROM tianon/centos:6.5
MAINTAINER [email protected]
# We also need Ruby for running squid's `url_rewrite_program` which is, in this configuration, written in Ruby.
RUN yum install -y squid ruby
# This also adds the "squid" user and group
ADD squid.conf /etc/squid/squid.conf
ADD rewrite.rb /etc/squid/rewrite.rb
# This is executed by squid's redirectors
# so we must make it executable or squid's redirectors will end up exiting rapidly.
RUN chmod +x /etc/squid/rewrite.rb
# Prepare dirs required by squid
RUN mkdir -p /usr/local/var/cache/squid
RUN chown -R squid:squid /usr/local/var/cache/squid
RUN mkdir -p /var/log/squid
RUN chown -R squid:squid /var/log/squid
# Make cache dirs
RUN squid -z -F
EXPOSE 80
# -X verbose debug logging
# -N Don't run in daemon mode - important for docker
ENTRYPOINT ["squid", "-N", "-X"]
CMD ["-d0"]