vmods and docker containers got easier

Guillaume Quintard guillaume.quintard at gmail.com
Thu Apr 28 20:38:00 UTC 2022


Hi everyone,

Here's a triplet of announcements that should make life easier for a bunch
of vmod users.

# install-vmod

Earlier this month I pushed
https://github.com/varnish/toolbox/tree/master/install-vmod which, I must
admit, takes inspiration from xcir's vmod-packager (
https://github.com/xcir/vmod-packager), but with a way less ambitious scope.

Essentially, you can just point install-vmod at a tarball (local or
remote), with an optional checksum and it will download, build, test and
install the vmod for you:

install-vmod
https://github.com/varnish/varnish-modules/releases/download/0.20.0/varnish-modules-0.20.0.tar.gz
e63d6da8f63a5ce56bc7a5a1dd1a908e4ab0f6a36b5bdc5709dca2aa9c0b474bd8a06491ed3dee23636d335241ced4c7ef017b57413b05792ad382f6306a0b36


It's only a few lines of shell and doesn't handle dependencies
installation, but it's pretty convenient for the next point.

# install-vmod in official docker images

install-vmod is included in all official images, making it very easy to
supplement the images with your own vmod combinations. Here's a and example
taken from the official docs (https://hub.docker.com/_/varnish):

FROM varnish:7.1-alpine


# install build dependencies
USER root
RUN set -e; \
    apk add --no-cache $VMOD_DEPS; \
    \
# install one, possibly multiple vmods
    install-vmod
https://github.com/varnish/varnish-modules/releases/download/0.20.0/varnish-modules-0.20.0.tar.gz;
\
    \
# clean up
    apk del --no-network $VMOD_DEPS
USER varnish


Note the VMOD_DEPS that allows you to quickly add and remove the general
building dependencies.

# official docker images now include varnish-modules and vmod_dynamic

Now that images have an easy way to install vmods, it seemed like a waste
to not install a couple of those, namely:
- varnish-modules (https://github.com/varnish/varnish-modules) because it's
full of tools that are useful in most setups (headers, var, str, etc.)
- vmod_dynamic (https://github.com/nigoroll/libvmod-dynamic) since
containers usually live in dynamic environments with backend with a DNS
record but no fixed IP

And those two have the big benefit of not requiring any extra dependencies
compared to Varnish, meaning the image size only slightly increased.

And that's it for now! As usual, feedback is welcome, especially since the
features are so new.

Until next time!

-- 
Guillaume Quintard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20220428/00370f35/attachment-0001.html>


More information about the varnish-misc mailing list