varnish / docker-varnish

Official docker image
https://hub.docker.com/_/varnish
82 stars 34 forks source link

6.0.7 and 6.0.8: 1) `varnish -V` bug 2) Varnish Modules 0.15.0 can't be installed #40

Closed adriendupuis closed 3 years ago

adriendupuis commented 3 years ago

Hi,

I had to renew my Docker containers built before summer 2021 and I'm experimenting strange behaviors with 6.0.8 and 6.0.7 images.

I used varnish -V just to check what patch varnish:6.0 image is retrieving. But it now answers with an absurd error:

root@2076079ebb0a:/etc/varnish# varnishd -V
Error: -V must be the first argument
(-? gives usage)
root@2076079ebb0a:/etc/varnish# whereis varnishd       
varnishd: /usr/sbin/varnishd /usr/local/bin/varnishd
root@2076079ebb0a:/etc/varnish# /usr/sbin/varnishd -V
varnishd (varnish-6.0.8 revision 97e54ada6ac578af332e52b44d2038bb4fa4cd4a)
Copyright (c) 2006 Verdens Gang AS
Copyright (c) 2006-2020 Varnish Software AS
root@2076079ebb0a:/etc/varnish# /usr/local/bin/varnishd -V
Error: -V must be the first argument
(-? gives usage)

This varnishd -V error occurs with varnish:6.0.8 and varnish:6.0.7 but not with varnish:6.0.6.

I also used to add Varnish Modules 0.15.0. to Varnish 6.0. Two problems occurs recently. First with the package containing the varnishapi, second while building vmods:

The simple fix for me having my setup working again was to replace varnish:6.0 with varnish:6.0.6. But I thought you need to know those issues with the last two patches.

Best regards, Adrien

gquintard commented 3 years ago

Hi @adriendupuis ,

The message is not absurd once you now what's going on, but I get how it can be confusing. In Varnish > 7.0, the workdir is set to /var/lib/varnish/$HOSTNAME by default. This led to problems with docker-compose setups where varnishd is running in one container with a hostname, and varnishlog is running in another, and they never meet.

So, we work around that by injecting wrapper scripts that will inject -n /var/lib/varnish in front of the varnish binaries. It works well most of the time, but will fail when you need to specify the first argument like you do, or when you have an incompatible argument (-r $FILE with varnishlogd for example).

To work around the work around, use the absolute path of the binary, that way you will get to the true binary directly, rather than the wrapper script.

For varnish-modules, the images should include varnish-dev, I'll check

gquintard commented 3 years ago

ok, in the debian case, the do install varnish-dev, but we the remove the build dependencies, including pkg-config. And that one is also a dependency of varnish-dev which get transitively removed.

keeping pkg-config around would mean fattening the image quite a bit (~130MB) and we don't want to do that. Instead we are going to dump the deb files into /pkgs and let you install it manually prior to compiling the vmods.

fixed by efa8f60de4abc4f388343bcc4088c2564aa89be7 and https://github.com/docker-library/official-images/pull/10968