-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
50 lines (41 loc) · 2.01 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM alpine:3.15 as vmod-builder
WORKDIR /build
RUN apk update
RUN apk add --quiet ca-certificates curl wget tar gzip jq
RUN wget -O libvmod-querystring.tgz https://github.com/Dridi/libvmod-querystring/releases/download/v1.0.5/vmod-querystring-1.0.5.tar.gz
RUN tar -zxvf libvmod-querystring.tgz && mv vmod-querystring* libvmod-querystring
RUN apk add --quiet build-base gcc make libtool varnish varnish-dev file python2
WORKDIR /build/libvmod-querystring
RUN ./configure --with-rst2man=: || cat config.log && \
make && \
make check && \
make install
FROM alpine:3.15 as prometheus-exporter-builder
WORKDIR /build
RUN apk update
RUN apk add --quiet ca-certificates curl wget tar gzip jq
RUN curl -sL https://api.github.com/repos/jonnenauha/prometheus_varnish_exporter/releases/latest | jq -r '.assets[] | select(.name | contains ("linux-386.tar.gz")) | .browser_download_url' | xargs wget -O prometheus_varnish_exporter.linux-386.tar.gz
RUN tar -zxvf prometheus_varnish_exporter.linux-386.tar.gz && mv ./prometheus_varnish_exporter-*/prometheus_varnish_exporter /prometheus_varnish_exporter
# Make sure we can run this binary
RUN /prometheus_varnish_exporter -version
FROM hairyhenderson/gomplate as gomplate
FROM alpine:3.15
MAINTAINER Frode Egeland <egeland@gmail.com>
ENV REFRESHED_AT 2017-11-02
ENV VARNISH_BACKEND_ADDRESS 192.168.1.65
ENV VARNISH_MEMORY 100M
ENV VARNISH_BACKEND_PORT 80
ENV VARNISH_VSL_RECLEN 255b
EXPOSE 80
RUN apk --no-cache add varnish bind-tools
# s6 overlay stuff
ENV S6_OVERLAY_VERSION=v1.21.7.0
COPY rootfs /
RUN apk add --no-cache curl \
&& curl -L -s https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-amd64.tar.gz \
| tar xvzf - -C /
COPY --from=vmod-builder /usr/lib/varnish/vmods/libvmod_querystring.so /usr/lib/varnish/vmods/libvmod_querystring.so
COPY --from=gomplate /gomplate /usr/local/bin/gomplate
COPY --from=prometheus-exporter-builder /prometheus_varnish_exporter /usr/local/bin/prometheus_varnish_exporter
ADD *.sh /
ENTRYPOINT [ "/init" ]