@@ -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