cdn-varnish/Dockerfile
Patrik Lundin 35a944d896
Some checks failed
/ container (push) Has been cancelled
Revert "See if it helps to allow unlimited locked memory"
We can not increase the ulimit from inside the job, instead we need to
tell forgejo (via /opt/forgejo-runner/data/config.yml) to include
e.g. "--ulimit memlock=-1" in container options if necessary.

This did not appear to help things however.

This reverts commit 2be4c8ea13.
2025-02-28 08:34:28 +01:00

56 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.6.1
# 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 c2e05e831ffc8095d9cc56510f24a5529ab16282 && \
./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