-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
executable file
·49 lines (39 loc) · 1.62 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
49
FROM ubuntu:jammy as build
WORKDIR /
# install varnish 6.0-lts dependencies
RUN apt-get update && \
apt-get install -y curl gnupg2 && \
curl -L https://packagecloud.io/varnishcache/varnish60lts/gpgkey | apt-key add - && \
echo "deb https://packagecloud.io/varnishcache/varnish60lts/ubuntu/ jammy main" | tee /etc/apt/sources.list.d/varnish-cache.list && \
apt-get update && \
apt-get install -y libgetdns-dev varnish=6.0.11-1~jammy varnish-dev=6.0.11-1~jammy
# install varnish-modules
RUN apt-get install -y git automake autoconf libtool python3 make docutils-common && \
git clone -b 6.0-lts https://github.com/varnish/varnish-modules.git && \
cd /varnish-modules && \
./bootstrap && \
./configure --prefix=/build && \
make && \
make install
# install vmod-basicauth
COPY vmod-basicauth-1.9/ /vmod-basicauth
RUN cd /vmod-basicauth && \
autoreconf -f -i && \
./configure --with-vmoddir="/build/lib/varnish/vmods" && \
make && \
make install
FROM ubuntu:jammy
# install varnish 6.0-lts dependencies
RUN apt-get update && \
apt-get install -y curl gnupg2 && \
curl -L https://packagecloud.io/varnishcache/varnish60lts/gpgkey | apt-key add - && \
echo "deb https://packagecloud.io/varnishcache/varnish60lts/ubuntu/ jammy main" | tee /etc/apt/sources.list.d/varnish-cache.list && \
apt-get update && \
apt-get install -y varnish=6.0.11-1~jammy
COPY --from=build /build/lib/varnish/vmods/ /usr/lib/varnish/vmods/
COPY --from=build /build/share/ /usr/share/
COPY default.vcl /etc/varnish/default.vcl
COPY start.sh /start.sh
RUN chmod +x /start.sh
EXPOSE 80
CMD ["/start.sh"]