forked from mparker17/docker-varnish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (44 loc) · 1.26 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM centos:7
MAINTAINER Fran Tsao <[email protected]>
# Forked from https://github.com/newsdev/docker-varnish
RUN \
groupadd -g 972 varnish
RUN \
useradd -u 972 -s /bin/false -g varnish varnish
# Install Varnish source build dependencies.
RUN \
yum install -y \
automake \
make \
gcc \
glibc-devel \
ca-certificates \
curl \
libedit-devel \
jemalloc-devel \
jemalloc \
ncurses-devel \
pcre-devel \
pcre \
libtool \
pkgconfig \
file \
dotconf \
python-docutils \
&& yum clean all
# Install Varnish from source, so that Varnish modules can be compiled and installed.
ENV VARNISH_VERSION=4.1.11
ENV VARNISH_SHA256SUM=f937a45116f3a7fbb38b2b5d7137658a4846409630bb9eccdbbb240e1a1379bc
RUN \
mkdir -p /usr/src && \
cd /usr/src && \
curl -sfLO https://varnish-cache.org/_downloads/varnish-$VARNISH_VERSION.tgz && \
echo "${VARNISH_SHA256SUM} varnish-$VARNISH_VERSION.tgz" | sha256sum -c - && \
tar -xzf varnish-$VARNISH_VERSION.tgz && \
cd varnish-$VARNISH_VERSION && \
./autogen.sh && \
./configure && \
make install && \
rm ../varnish-$VARNISH_VERSION.tgz
EXPOSE 8080
ENTRYPOINT [ "/usr/local/sbin/varnishd", "-j", "unix,user=varnish", "-F", "-f", "/etc/varnish/default.vcl", "-a", "0.0.0.0:8080" ]