|
1 | 1 | # Starting from Ubuntu and not from alpine, as libvmod-dynamic used for generating dynamic backends |
2 | 2 | # compiles currently only on debian based images. |
3 | | -FROM ubuntu:bionic |
| 3 | +FROM ubuntu:jammy |
4 | 4 |
|
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 |
6 | 12 |
|
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 && \ |
17 | 17 | ./autogen.sh && \ |
18 | 18 | ./configure && \ |
19 | 19 | 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 |
25 | 21 |
|
| 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 / |
26 | 29 | COPY default.vcl /etc/varnish/default.vcl |
27 | 30 | COPY start.sh /start.sh |
28 | | - |
29 | 31 | RUN chmod +x /start.sh |
| 32 | + |
| 33 | +# Expose port and start |
30 | 34 | EXPOSE 80 |
31 | 35 | CMD ["/start.sh"] |
0 commit comments