forked from mparker17/docker-varnish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (41 loc) · 1.24 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 debian:jessie
RUN \
useradd -r -s /bin/false varnishd
# Install Varnish source build dependencies.
RUN \
apt-get update && apt-get install -y --no-install-recommends \
automake \
build-essential \
ca-certificates \
curl \
libedit-dev \
libjemalloc-dev \
libncurses-dev \
libpcre3-dev \
libtool \
pkg-config \
python-docutils \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install Varnish from source, so that Varnish modules can be compiled and installed.
ENV VARNISH_VERSION=4.1.0
ENV VARNISH_SHA256SUM=4a6ea08e30b62fbf25f884a65f0d8af42e9cc9d25bf70f45ae4417c4f1c99017
RUN \
apt-get update && \
mkdir -p /usr/local/src && \
cd /usr/local/src && \
curl -sfLO https://repo.varnish-cache.org/source/varnish-$VARNISH_VERSION.tar.gz && \
echo "${VARNISH_SHA256SUM} varnish-$VARNISH_VERSION.tar.gz" | sha256sum -c - && \
tar -xzf varnish-$VARNISH_VERSION.tar.gz && \
cd varnish-$VARNISH_VERSION && \
./autogen.sh && \
./configure && \
make install && \
rm ../varnish-$VARNISH_VERSION.tar.gz
COPY start-varnishd.sh /usr/local/bin/start-varnishd
ENV VARNISH_PORT 80
ENV VARNISH_MEMORY 100m
ENV VARNISH_VCL default
EXPOSE 80
CMD ["start-varnishd"]
ONBUILD COPY *.vcl /etc/varnish/