Skip to content

Commit 8ca1621

Browse files
Upgrade Dockerfile base image from Ubuntu 18.04 LTS to 22.04 LTS
Switch from Varnish 6.2 to 6.0 LTS version. There is no 6.2 build for Ubuntu 22.04 LTS.
1 parent d5a153a commit 8ca1621

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

Dockerfile

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,35 @@
11
# Starting from Ubuntu and not from alpine, as libvmod-dynamic used for generating dynamic backends
22
# compiles currently only on debian based images.
3-
FROM ubuntu:bionic
3+
FROM ubuntu:jammy
44

5-
ENV VARNISHSRC=/usr/include/varnish VMODDIR=/usr/lib/varnish/vmods
5+
# Install build dependencies
6+
RUN apt-get update && \
7+
apt-get install -y curl apt-transport-https gnupg && \
8+
curl -L https://packagecloud.io/varnishcache/varnish60lts/gpgkey | apt-key add - && \
9+
echo "deb https://packagecloud.io/varnishcache/varnish60lts/ubuntu/ jammy main" | tee /etc/apt/sources.list.d/varnish-cache.list && \
10+
apt-get update && \
11+
apt-get install -y libgetdns-dev varnish=6.0.11-1~jammy varnish-dev=6.0.11-1~jammy
612

7-
RUN apt-get update -q && \
8-
apt-get install -qq git curl apt-transport-https autotools-dev automake autoconf libtool python make python-docutils sudo gnupg2 && \
9-
curl -L https://packagecloud.io/varnishcache/varnish62/gpgkey | sudo apt-key add - && \
10-
echo "deb https://packagecloud.io/varnishcache/varnish62/ubuntu/ bionic main" | tee /etc/apt/sources.list.d/varnish-cache.list && \
11-
apt-get -q update && \
12-
apt-get install -qq libgetdns-dev && \
13-
apt-get install -qq varnish varnish-dev && \
14-
cd / && echo "-------mod-dynamic build -------" && \
15-
git clone -b 6.2 https://github.com/nigoroll/libvmod-dynamic.git && \
16-
cd libvmod-dynamic && \
13+
# Clone and compile libvmod-dynamic
14+
RUN apt-get -y install git autotools-dev automake autoconf libtool make docutils-common
15+
RUN git clone -b 6.0 https://github.com/nigoroll/libvmod-dynamic.git /tmp/libvmod-dynamic && \
16+
cd /tmp/libvmod-dynamic && \
1717
./autogen.sh && \
1818
./configure && \
1919
make && \
20-
make install && \
21-
apt-get remove -qq git curl apt-transport-https autotools-dev automake autoconf libtool python make python-docutils gnupg2 --allow-remove-essential && \
22-
apt-get -qq autoremove && \
23-
apt-get -qq clean && \
24-
rm -rf /libvmod-dynamic
20+
make install
2521

22+
# Remove build dependencies and clean up
23+
RUN apt-get remove -y curl apt-transport-https gnupg git autotools-dev automake autoconf libtool make docutils-common varnish-dev && \
24+
apt-get autoremove -y && \
25+
apt-get clean && \
26+
rm -rf /var/lib/apt/lists/* /tmp/*
27+
28+
WORKDIR /
2629
COPY default.vcl /etc/varnish/default.vcl
2730
COPY start.sh /start.sh
28-
2931
RUN chmod +x /start.sh
32+
33+
# Expose port and start
3034
EXPOSE 80
3135
CMD ["/start.sh"]

0 commit comments

Comments
 (0)