cdn-varnish/Dockerfile
Patrik Lundin af7f7d11e6
All checks were successful
/ container (push) Successful in 13m15s
Initial commit
2024-10-04 12:48:34 +02:00

57 lines
2.3 KiB
Docker

# syntax=docker/dockerfile:1-labs
# The above is needed to give us access to "RUN --security=insecure" below, and
# this is needed to make fellow tests succeed. Otherwise the docker sandbox
# will prevent access to io_uring:
#
# /tmp/slash/src/test-suite.log:
# ===
# fellow: io_uring try: FATAL, got -1 (Operation not permitted)
# Wrong turn in try_flag(), fellow_io_uring.c line 262: Unexpected io_uring error. Is it available?
# errno = 1 (Operation not permitted)
# ===
# Dockerfile contents Based on
# https://github.com/varnish/docker-varnish/blob/master/vmod-examples/Dockerfile.with-varnish-src
# to get access to varnish source as expected by slash build steps.
FROM varnish:7.5.0
# https://code.uplex.de/uplex-varnish/slash/blob/master/INSTALL.rst
ENV SLASH_DEPS="git autoconf autoconf-archive automake libtool python3-docutils python3-sphinx libpcre2-dev libreadline-dev liburing-dev libxxhash-dev libncurses-dev"
ENV SLASH_RUNTIME_DEPS="liburing2 libxxhash0"
ENV VARNISHSRC=/tmp/varnish-cache
# Might as well use a variable for the slash source as well
ENV SLASHSRC=/tmp/slash
USER root
# --security=insecure is not supported by kaniko, but needed if building
# directly with docker, comment out the one you dont need.
#RUN --security=insecure set -e && \
RUN set -e && \
# get the dependencies
apt-get update && \
apt-get -y install /pkgs/*.deb $VMOD_DEPS $SLASH_DEPS $SLASH_RUNTIME_DEPS && \
# grab the right commit of the Varnish source
git clone https://github.com/varnishcache/varnish-cache.git $VARNISHSRC && \
cd /tmp/varnish-cache && \
# make sure to check out the exact same version that's already compiled and installed
git checkout $(varnishd -V 2>&1 | grep -o '[0-9a-f]\{40\}*') && \
# BEGIN slash specific
./autogen.des && \
cd include && \
make vcs_version.h && \
cd ../lib/libvsc && \
make && \
git clone https://code.uplex.de/uplex-varnish/slash.git $SLASHSRC && \
cd $SLASHSRC && \
# use specific commit for reproducibility
git checkout a06224b9c6087349c511135f6011a3d33aacf934 && \
./bootstrap && \
make check && \
make install && \
# END slash specific
apt-get -y purge --auto-remove $VMOD_DEPS varnish-dev $SLASH_DEPS && \
rm -rf /var/lib/apt/lists/* $VARNISHSRC $SLASHSRC
USER varnish