Skip to content

Commit 9970151

Browse files
committed
feat: Publish livingdocs/varnish:7.6.1-r0
1 parent 79f0255 commit 9970151

File tree

2 files changed

+34
-8
lines changed

2 files changed

+34
-8
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
FROM golang:1.13.10-alpine3.11 as go
1+
FROM golang:1.23.5-alpine3.21 AS go
22
RUN apk add --no-cache git
3-
RUN go get -d github.com/jonnenauha/prometheus_varnish_exporter
4-
RUN cd /go/src/github.com/jonnenauha/prometheus_varnish_exporter && git checkout 1.6 && go build -ldflags "-X 'main.Version=1.6' -X 'main.VersionHash=$(git rev-parse --short HEAD)' -X 'main.VersionDate=$(date -u '+%d.%m.%Y %H:%M:%S')'" -o /go/bin/prometheus_varnish_exporter
3+
RUN git clone https://github.com/jonnenauha/prometheus_varnish_exporter.git
4+
RUN cd prometheus_varnish_exporter && git checkout 1.6 && go build -ldflags "-X 'main.Version=1.6' -X 'main.VersionHash=$(git rev-parse --short HEAD)' -X 'main.VersionDate=$(date -u '+%d.%m.%Y %H:%M:%S')'" -o /go/bin/prometheus_varnish_exporter
55

6-
FROM node:20-alpine
6+
FROM node:22-alpine
77
WORKDIR /etc/varnish
8-
ENV VARNISH_VERSION=7.3.0-r1
8+
ENV VARNISH_VERSION=7.6.1-r0
99

1010
COPY --from=go /go/bin/* /usr/local/bin/
1111

@@ -15,7 +15,7 @@ RUN echo 'Install utils that stay in the image' \
1515
&& apk add --no-cache varnish=$VARNISH_VERSION --repository http://dl-3.alpinelinux.org/alpine/edge/main/ \
1616
&& echo 'Install varnish-modules' \
1717
&& apk add --virtual varnish-deps --no-cache git libgit2-dev automake varnish-dev=$VARNISH_VERSION autoconf libtool py-docutils make --repository http://dl-3.alpinelinux.org/alpine/edge/main/ \
18-
&& git clone https://github.com/varnish/varnish-modules.git /varnish-modules --depth='1' --branch='7.3' --single-branch \
18+
&& git clone https://github.com/varnish/varnish-modules.git /varnish-modules --depth='1' --branch='7.6' --single-branch \
1919
&& cd /varnish-modules && ./bootstrap && ./configure && make && make install && cd / \
2020
&& echo 'Remove all build deps' \
2121
&& rm -Rf /varnish-modules \

README.md

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,34 @@ How this is different than other varnish operators for Kubernetes:
1717

1818
### Build
1919

20+
For multi arch builds on Docker we use buildx. You have to create a builder before being able to build the containers.
21+
```
22+
docker buildx create --name container --driver=docker-container container
23+
```
24+
25+
The following functions are used to build and push images on x86 machines:
26+
```
27+
buildcontainer () { docker buildx build --no-cache --platform linux/amd64,linux/arm64 "$@" }
28+
pushcontainer () { for var in "$@"; do docker push "$var"; done }
29+
```
30+
31+
On Apple Silicon Macs, you have to upload the images to a registry that supports multi-arch images in one step.
32+
33+
```
34+
buildcontainer () { docker buildx build --no-cache --push --platform linux/amd64,linux/arm64 "$@" }
35+
```
36+
37+
With Lima
38+
```
39+
lima sudo systemctl start containerd
40+
lima sudo nerdctl run --privileged --rm tonistiigi/binfmt:qemu-v8.1.5 --install all
41+
42+
buildcontainer () { nerdctl build --platform=amd64,arm64 "$@" }
43+
pushcontainer () { for var in "$@"; do nerdctl push --all-platforms "$var"; done }
44+
```
45+
2046
```sh
21-
docker build -t livingdocs/varnish .
47+
buildcontainer -t livingdocs/varnish .
2248
```
2349

2450
### Run
@@ -38,7 +64,7 @@ Attention, parameters in the config file always overwrite those cli parameters.
3864

3965
```sh
4066
# For example use microcaching of requests, use a ttl of 1
41-
docker run --rm -it -p 8080:8080 --name varnish livingdocs/varnish --backend host.docker.internal:8081 -p default_ttl=1 -p default_grace=60
67+
docker run --rm -it -p 8080:8080 --name varnish livingdocs/varnish --backend example.com:80 -p default_ttl=1 -p default_grace=60
4268
```
4369

4470
### With YAML config file

0 commit comments

Comments
 (0)