Skip to content

Instantly share code, notes, and snippets.

@gquintard
Last active May 12, 2022 07:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gquintard/c473c3f16a1f655383062ad66c2b8e5e to your computer and use it in GitHub Desktop.
Save gquintard/c473c3f16a1f655383062ad66c2b8e5e to your computer and use it in GitHub Desktop.
vmod-request docker
FROM ubuntu:focal
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get update
RUN apt-get install -y curl cargo git pkg-config libssl-dev clang
RUN curl -s https://packagecloud.io/install/repositories/varnishcache/varnish71/script.deb.sh | bash
RUN apt-get install -y varnish-dev
RUN git clone https://github.com/gquintard/vmod_reqwest.git
WORKDIR /vmod_reqwest
RUN cargo build --release
RUN cp target/release/libvmod_reqwest.so $(pkg-config --variable=vmoddir varnishapi)
RUN echo 'vcl 4.1; import reqwest; backend be none;' > /tmp/test.vcl
RUN varnishd -C -f /tmp/test.vcl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment