Skip to content

Commit b41d0f8

Browse files
authored
[varnish] document install vmods (#2134)
1 parent d0d73f0 commit b41d0f8

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

varnish/content.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,43 @@ $ docker run %%IMAGE%% varnishd -F -a :8080 -b 127.0.0.1:8181 -t 600 -p feature=
114114
## vmods (since 7.1)
115115

116116
As mentioned above, you can use [vmod_dynamic](https://github.com/nigoroll/libvmod-dynamic) for backend resolution. The [varnish-modules](https://github.com/varnish/varnish-modules) collection is also included in the image. All the documentation regarding usage and syntax can be found in the [src/](https://github.com/varnish/varnish-modules/tree/master/src) directory of the repository.
117+
118+
On top of this, images include [install-vmod](https://github.com/varnish/toolbox/tree/master/install-vmod), a helper script to quickly download, compile and install vmods while creating your own images. Note that images set the `ENV` variable `VMOD_DEPS` to ease the task further.
119+
120+
### Debian
121+
122+
```dockerfile
123+
FROM %%IMAGE%%:7.1
124+
125+
# set the user to root, and install build dependencies
126+
USER root
127+
RUN set -e; \
128+
apt-get update; \
129+
apt-get -y install $VMOD_DEPS /pkgs/*.deb; \
130+
\
131+
# install one, possibly multiple vmods
132+
install-vmod https://github.com/varnish/varnish-modules/releases/download/0.20.0/varnish-modules-0.20.0.tar.gz; \
133+
\
134+
# clean up and set the user back to varnish
135+
apt-get -y purge --auto-remove $VMOD_DEPS varnish-dev; \
136+
rm -rf /var/lib/apt/lists/*
137+
USER varnish
138+
```
139+
140+
### Alpine
141+
142+
```dockerfile
143+
FROM %%IMAGE%%:7.1-alpine
144+
145+
# install build dependencies
146+
USER root
147+
RUN set -e; \
148+
apk add --no-cache $VMOD_DEPS; \
149+
\
150+
# install one, possibly multiple vmods
151+
install-vmod https://github.com/varnish/varnish-modules/releases/download/0.20.0/varnish-modules-0.20.0.tar.gz; \
152+
\
153+
# clean up
154+
apk del --no-network $VMOD_DEPS
155+
USER varnish
156+
```

0 commit comments

Comments
 (0)