Skip to content

[varnish] add install-vmod #12241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 21, 2022

Conversation

gquintard
Copy link
Contributor

add a convenience script to install vmods

@gquintard
Copy link
Contributor Author

waiting on nigoroll/libvmod-dynamic#86

@gquintard gquintard force-pushed the varnish-install-vmod branch from d7caeaf to c2d31ee Compare April 14, 2022 08:52
@gquintard gquintard force-pushed the varnish-install-vmod branch from c2d31ee to 903ae6d Compare April 21, 2022 11:51
@gquintard gquintard marked this pull request as ready for review April 21, 2022 11:54
@gquintard gquintard marked this pull request as draft April 21, 2022 11:55
@gquintard gquintard force-pushed the varnish-install-vmod branch 2 times, most recently from a8471a5 to c2d6222 Compare April 21, 2022 11:59
@github-actions
Copy link

Diff for c2d6222:
diff --git a/_bashbrew-cat b/_bashbrew-cat
index 066f9fd..742a9da 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -3,12 +3,12 @@ GitRepo: https://github.com/varnish/docker-varnish.git
 
 Tags: fresh, 7.1.0, 7.1, latest
 Architectures: amd64, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: e507d06e425154234046ed779dc72dd449c178ac
+GitCommit: 213ce5361fe416b0125b3843f11bf98cbf68729e
 Directory: fresh/debian
 
 Tags: fresh-alpine, 7.1.0-alpine, 7.1-alpine, alpine
 Architectures: amd64, arm32v7, arm64v8, i386, ppc64le, s390x
-GitCommit: e507d06e425154234046ed779dc72dd449c178ac
+GitCommit: 213ce5361fe416b0125b3843f11bf98cbf68729e
 Directory: fresh/alpine
 
 Tags: old, 7.0.2, 7.0
diff --git a/varnish_alpine/Dockerfile b/varnish_alpine/Dockerfile
index cbe86c2..2c9de81 100644
--- a/varnish_alpine/Dockerfile
+++ b/varnish_alpine/Dockerfile
@@ -6,8 +6,10 @@ ARG  DIST_SHA512=ad9ce0cdc759976fcb7044914d28863edd197167f583fab2d1bc57f4e5b86c2
 ARG  VARNISH_MODULES_VERSION=0.20.0
 ARG  VARNISH_MODULES_SHA512SUM=e63d6da8f63a5ce56bc7a5a1dd1a908e4ab0f6a36b5bdc5709dca2aa9c0b474bd8a06491ed3dee23636d335241ced4c7ef017b57413b05792ad382f6306a0b36
 ARG  VMOD_DYNAMIC_VERSION=2.6.0
-ARG  VMOD_DYNAMIC_COMMIT=9666973952f62110c872d720af3dae0b85b4b597
-ARG  VMOD_DYNAMIC_SHA512SUM=e62f1ee801ab2c9e22f5554bbe40c239257e2c46ea3d2ae19b465b1c82edad6f675417be8f7351d4f9eddafc9ad6c0149f88edc44dd0b922ad82e5d75b6b15a5
+ARG  VMOD_DYNAMIC_COMMIT=025e9918f6cba33135e16e0fb0d86b4c34b6dd5a
+ARG  VMOD_DYNAMIC_SHA512SUM=89b7251529c4c63c408b83c59e32b54b94b0f31f83614a34b3ffc4fb96ebdac5b6f8b5fe5b95056d5952a3c0a0217c935c5073c38415f7680af748e58c041816
+ARG  TOOLBOX_COMMIT=96bab07cf58b6e04824ffec608199f1780ff0d04
+ENV  VMOD_DEPS="automake curl gcc libtool make pkgconfig py3-sphinx"
 
 ENV VARNISH_SIZE 100M
 
@@ -34,34 +36,16 @@ RUN set -e;\
     apk add --allow-untrusted ~builder/packages/pkg-varnish-cache/*/*.apk; \
     echo -e 'vcl 4.1;\nbackend default none;' > /etc/varnish/default.vcl; \
     \
+    git clone https://github.com/varnish/toolbox.git; \
+    cd toolbox; \
+    git checkout $TOOLBOX_COMMIT; \
+    cp install-vmod/install-vmod /usr/local/bin/; \
+    \
     # varnish-modules
-    mkdir -p /work/varnish-modules; \
-    cd /work/varnish-modules; \
-    curl -fLo src.tar.gz https://github.com/varnish/varnish-modules/releases/download/$VARNISH_MODULES_VERSION/varnish-modules-$VARNISH_MODULES_VERSION.tar.gz; \
-    echo "$VARNISH_MODULES_SHA512SUM  src.tar.gz" | sha512sum -c -; \
-    tar xavf src.tar.gz --strip 1; \
-    ./configure --libdir=/usr/lib; \
-    make -j"$(nproc)" VERBOSE=1 install; \
-    make -j"$(nproc)" VERBOSE=1 check; \
+    install-vmod https://github.com/varnish/varnish-modules/releases/download/$VARNISH_MODULES_VERSION/varnish-modules-$VARNISH_MODULES_VERSION.tar.gz $VARNISH_MODULES_SHA512SUM; \
     \
     # vmod-dynamic
-    mkdir /work/vmod-dynamic; \
-    cd /work/vmod-dynamic; \
-    curl -fLo src.tar.gz https://github.com/nigoroll/libvmod-dynamic/archive/$VMOD_DYNAMIC_COMMIT.tar.gz; \
-    echo "$VMOD_DYNAMIC_SHA512SUM  src.tar.gz" | sha512sum -c -; \
-    tar xavf src.tar.gz --strip 1; \
-    # patching things up for armv8
-    sed -i '14 a AC_CHECK_HEADERS([stdatomic.h])' configure.ac; \
-    git clone https://github.com/varnishcache/varnish-cache.git; \
-    cd varnish-cache; \
-    git checkout d48636d23bb277ca8650a6174c872d74080f2859; \
-    cp include/vmb.h ../src/vmb.h; \
-    cd /work/vmod-dynamic; \
-    # actual build
-    ./autogen.sh; \
-    ./configure --libdir=/usr/lib; \
-    make -j"$(nproc)" VERBOSE=1 install; \
-    make -j"$(nproc)" VERBOSE=1 check; \
+    install-vmod https://github.com/nigoroll/libvmod-dynamic/archive/$VMOD_DYNAMIC_COMMIT.tar.gz $VMOD_DYNAMIC_SHA512SUM; \
     \
     # cleanup
     apk del --no-network varnish-build-deps; \
diff --git a/varnish_latest/Dockerfile b/varnish_latest/Dockerfile
index 1c6ee2d..bd9c500 100644
--- a/varnish_latest/Dockerfile
+++ b/varnish_latest/Dockerfile
@@ -6,8 +6,10 @@ ARG  DIST_SHA512=ad9ce0cdc759976fcb7044914d28863edd197167f583fab2d1bc57f4e5b86c2
 ARG  VARNISH_MODULES_VERSION=0.20.0
 ARG  VARNISH_MODULES_SHA512SUM=e63d6da8f63a5ce56bc7a5a1dd1a908e4ab0f6a36b5bdc5709dca2aa9c0b474bd8a06491ed3dee23636d335241ced4c7ef017b57413b05792ad382f6306a0b36
 ARG  VMOD_DYNAMIC_VERSION=2.6.0
-ARG  VMOD_DYNAMIC_COMMIT=9666973952f62110c872d720af3dae0b85b4b597
-ARG  VMOD_DYNAMIC_SHA512SUM=e62f1ee801ab2c9e22f5554bbe40c239257e2c46ea3d2ae19b465b1c82edad6f675417be8f7351d4f9eddafc9ad6c0149f88edc44dd0b922ad82e5d75b6b15a5
+ARG  VMOD_DYNAMIC_COMMIT=025e9918f6cba33135e16e0fb0d86b4c34b6dd5a
+ARG  VMOD_DYNAMIC_SHA512SUM=89b7251529c4c63c408b83c59e32b54b94b0f31f83614a34b3ffc4fb96ebdac5b6f8b5fe5b95056d5952a3c0a0217c935c5073c38415f7680af748e58c041816
+ARG  TOOLBOX_COMMIT=96bab07cf58b6e04824ffec608199f1780ff0d04
+ENV  VMOD_DEPS="automake curl gcc libtool make pkg-config python3-sphinx"
 
 ENV VARNISH_SIZE 100M
 
@@ -34,30 +36,17 @@ RUN set -e; \
     apt-get -y install ../*.deb; \
     mv ../*dev*.deb /pkgs; \
     \
+    git clone https://github.com/varnish/toolbox.git; \
+    cd toolbox; \
+    git checkout $TOOLBOX_COMMIT; \
+    cp install-vmod/install-vmod /usr/local/bin/; \
+    \
     # varnish-modules
-    mkdir /work/varnish-modules; \
-    cd /work/varnish-modules; \
-    curl -fLo src.tar.gz https://github.com/varnish/varnish-modules/releases/download/$VARNISH_MODULES_VERSION/varnish-modules-$VARNISH_MODULES_VERSION.tar.gz; \
-    echo "$VARNISH_MODULES_SHA512SUM  src.tar.gz" | sha512sum -c -; \
-    tar xavf src.tar.gz --strip 1; \
-    ./configure --libdir=/usr/lib; \
-    make -j"$(nproc)" VERBOSE=1 install; \
-    make -j"$(nproc)" VERBOSE=1 check; \
+    install-vmod https://github.com/varnish/varnish-modules/releases/download/$VARNISH_MODULES_VERSION/varnish-modules-$VARNISH_MODULES_VERSION.tar.gz $VARNISH_MODULES_SHA512SUM; \
     \
     # vmod-dynamic
-    mkdir /work/vmod-dynamic; \
-    cd /work/vmod-dynamic; \
-    curl -fLo src.tar.gz https://github.com/nigoroll/libvmod-dynamic/archive/$VMOD_DYNAMIC_COMMIT.tar.gz; \
-    echo "$VMOD_DYNAMIC_SHA512SUM  src.tar.gz" | sha512sum -c -; \
-    tar xavf src.tar.gz --strip 1; \
-    # patching things up for armv8
-    cp /work/varnish/pkg-varnish-cache/include/vmb.h src/vmb.h; \
-    sed -i '14 a AC_CHECK_HEADERS([stdatomic.h])' configure.ac; \
-    # actual build
-    ./autogen.sh; \
-    ./configure --libdir=/usr/lib; \
-    make -j"$(nproc)" VERBOSE=1 install; \
-    make -j"$(nproc)" VERBOSE=1 check; \
+    install-vmod https://github.com/nigoroll/libvmod-dynamic/archive/$VMOD_DYNAMIC_COMMIT.tar.gz $VMOD_DYNAMIC_SHA512SUM; \
+    \
     # clean up
     apt-get -y purge --auto-remove varnish-build-deps $BASE_PKGS; \
     rm -rf /var/lib/apt/lists/* /work/ /usr/lib/varnish/vmods/libvmod_*.la; \

Relevant Maintainers:

@gquintard gquintard marked this pull request as ready for review April 21, 2022 12:14
@gquintard
Copy link
Contributor Author

the vmod_dynamic fix has been merged, so we should now be able to build on all platforms

@yosifkit yosifkit merged commit 2b10762 into docker-library:master Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants