Skip to content

Commit

Permalink
Merge branch '1.7' into 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
andrerom committed Aug 26, 2017
2 parents 1a54201 + 2c946db commit 0373a7c
Showing 1 changed file with 43 additions and 9 deletions.
52 changes: 43 additions & 9 deletions doc/docker/Dockerfile-varnish
@@ -1,19 +1,53 @@
FROM debian:stretch-slim

ENV DEBIAN_FRONTEND noninteractive
ENV VARNISH_MALLOC_SIZE="256M" \
DEBIAN_FRONTEND=noninteractive

# Use packages from Varnish to get Varnsih 5.1, 5.0 packages with debian:stretch gives segmentation faults
RUN apt-get update -q -y && \
apt-get install -q -y --no-install-recommends ca-certificates curl && \
curl -s https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh | bash && \
apt-get install -q -y --allow-unauthenticated --no-install-recommends varnish && \
rm -rf /var/lib/apt/lists/*
ARG PACKAGECLOUD_URL=https://packagecloud.io/install/repositories/varnishcache/varnish5/script.deb.sh
ARG VARNISH_MODULES_VERSION=0.12.1

# Use offical packages from Varnish and build with varnish-modules mainly for xkey
# see: https://github.com/varnish/varnish-modules/tree/master/docs
RUN set -xe \
&& buildDeps=" \
make \
automake \
autotools-dev \
libedit-dev \
libjemalloc-dev \
libncurses-dev \
libpcre3-dev \
libtool \
pkg-config \
python-docutils \
python-sphinx \
varnish-dev \
" \
# Update apt and get dependencies
&& apt-get update -q -y \
&& apt-get install -q -y --no-install-recommends ca-certificates curl \
\
# Get offical Varnish package
&& curl -s ${PACKAGECLOUD_URL} | bash \
&& apt-get install -q -y --allow-unauthenticated --no-install-recommends varnish $buildDeps \
\
# Install varnish modules
&& curl -A "Docker" -o /tmp/varnish-modules.tar.gz -D - -L -s https://download.varnish-software.com/varnish-modules/varnish-modules-${VARNISH_MODULES_VERSION}.tar.gz \
&& tar zxpf /tmp/varnish-modules.tar.gz -C /tmp/ \
&& cd /tmp/varnish-modules-${VARNISH_MODULES_VERSION} \
&& ./configure \
&& make \
# && make check \
&& make install \
&& rm -f /tmp/varnish-modules.tar.gz && rm -Rf /tmp/varnish-modules \
\
# Cleanup apt cache and remove build packages
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDeps \
&& rm -rf /var/lib/apt/lists/*

COPY doc/varnish/vcl/varnish4.vcl /etc/varnish/default.vcl
COPY doc/docker/entrypoint/varnish/parameters.vcl /etc/varnish/parameters.vcl

ENV VARNISH_MALLOC_SIZE="256M"

EXPOSE 80 6082

# CMD in shell form to be able to use env variables here
Expand Down

0 comments on commit 0373a7c

Please sign in to comment.