Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 31 additions & 20 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,42 @@ jobs:
- name: "Test image"
run: "make test"

version:
name: "Version"
build:
name: "Build"
needs: test
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v7

- name: Read VERSION
id: version
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"
run: cat VERSION >> "$GITHUB_OUTPUT"

build:
name: "Build"
needs: ["test", "version"]
strategy:
fail-fast: false
matrix:
tag: ["latest", "${{ needs.version.outputs.version }}"]
if: github.ref == 'refs/heads/master'
uses: dockette/.github/.github/workflows/docker.yml@master
secrets: inherit
with:
image: "dockette/varnish"
tag: ${{ matrix.tag }}
context: "."
- name: Set up QEMU
uses: docker/setup-qemu-action@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4

- name: Login to DockerHub
if: github.ref == 'refs/heads/master'
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.ref == 'refs/heads/master' }}
tags: |
dockette/varnish:latest
dockette/varnish:${{ steps.version.outputs.VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max

release:
name: "Release"
Expand All @@ -78,7 +87,9 @@ jobs:
- name: Create release
env:
GH_TOKEN: ${{ github.token }}
run: gh release view "$(cat VERSION)" || gh release create "$(cat VERSION)" --generate-notes
run: |
. ./VERSION
gh release view "$VERSION" || gh release create "$VERSION" --generate-notes

docs:
name: "Docs"
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Dockette Varnish builds `dockette/varnish`, a legacy Varnish Cache image for old
- Build context: repository root `.` with `Dockerfile`, `entrypoint.sh`, and `varnish/default.vcl`.
- Default backend expected by the bundled VCL: `app:80`.
- Default exposed runtime behavior: Varnish listens on port `80` and `varnishlog` keeps the container attached.
- GitHub Actions builds `linux/amd64` for tests, then publishes `linux/amd64,linux/arm64` through the shared Dockette Docker workflow on `master` and the weekly schedule.
- GitHub Actions builds `linux/amd64` for tests, then builds `linux/amd64,linux/arm64` in one inline build job. Only `master` and the weekly schedule push to Docker Hub.

## Commands

Expand All @@ -32,4 +32,4 @@ Dockette Varnish builds `dockette/varnish`, a legacy Varnish Cache image for old
- Place `.PHONY: <target>` directly above each Makefile target.
- Keep README badges and maintenance sections consistent with other Dockette image repos.
- Do not introduce unrelated modernization or runtime behavior changes.
- `VERSION` is the release date; `make release` bumps it. CI pushes `latest` also as `<VERSION>` and creates the GitHub release.
- `VERSION` holds the release date as `VERSION=YYYY.MM.DD`; `make release` sets it. CI pushes `latest` also as `<VERSION>` and creates the GitHub release.
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DOCKER_IMAGE=dockette/varnish
DOCKER_TAG?=latest
DOCKER_PLATFORMS?=linux/amd64,linux/arm64
VERSION:=$(shell cat VERSION)
include VERSION

.PHONY: build
build:
Expand All @@ -26,6 +26,5 @@ version:

.PHONY: release
release:
@date -u +%Y.%m.%d > VERSION
@echo "VERSION: ${VERSION} -> $$(cat VERSION)"
@echo "next: git commit -am \"Release: $$(cat VERSION)\" && git push"
@sed -i.bak "s/^VERSION=.*/VERSION=$$(date -u +%Y.%m.%d)/" VERSION && rm VERSION.bak
@cat VERSION
65 changes: 32 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,58 +13,57 @@

-----

Legacy [Varnish Cache](https://varnish-cache.org) image with the bundled `default.vcl` and the entrypoint used by older
Dockette stacks. It keeps the historical behavior on purpose.

## Features

- Varnish on `dockette/debian:trixie`, listening on port `80`
- Bundled `default.vcl` that expects the backend application as `app:80`
- The entrypoint starts `varnishd` with the bundled VCL and then follows `varnishlog`
- No modern healthcheck, init wrapper or generated runtime configuration

## Usage

```bash
docker run --rm -it \
-p 80:80 \
--link app:app \
dockette/varnish:latest
```sh
docker run --rm -it -p 80:80 --link app:app dockette/varnish:latest
```

The bundled VCL expects the backend application to be reachable as `app:80`.
```sh
# Custom VCL, when the default backend or caching rules do not fit your stack
docker run --rm -it -p 80:80 -v "$(pwd)/default.vcl:/etc/varnish/default.vcl:ro" dockette/varnish:latest
```

## Configuration

The image keeps the original legacy defaults:
Defaults of the legacy image:

- `VARNISH_SECRET=/etc/varnish/secret`
- `VARNISH_CONFIG=/etc/varnish/default.vcl`
- `VARNISH_CACHE=256m`
- `VARNISH_PORT=80`

Mount a custom VCL file when the default backend or caching rules do not fit your stack:

```bash
docker run --rm -it \
-p 80:80 \
-v "$(pwd)/default.vcl:/etc/varnish/default.vcl:ro" \
dockette/varnish:latest
```

## Legacy Constraints

This repository intentionally preserves the historical image behavior. The entrypoint starts `varnishd` with the bundled VCL and then follows `varnishlog`; it does not provide a modern healthcheck, init wrapper, or generated runtime configuration.

The CI smoke test focuses on build viability, Varnish version output, entrypoint presence, bundled config presence, and VCL compilation.

## Versions

The release version is the date in [`VERSION`](VERSION). CI pushes `latest` also as `dockette/varnish:<VERSION>`.
To release, run `make release`, commit and push to `master`.
| Version | Release |
|---------|---------|
| `dockette/varnish:YYYY.MM.DD` | release `YYYY.MM.DD` |
| `dockette/varnish:latest` | latest build of `master` |

All versions build on `dockette/debian:trixie`. Releases are listed on
[GitHub](https://github.com/dockette/varnish/releases).

## Development

```bash
make build
make test
make run
make version
make release
```sh
make build # build linux/amd64 and linux/arm64
make test # check varnishd, entrypoint, bundled config and VCL compilation
make run # run on port 80 with a temporary nginx backend as app:80
make version # print VERSION
make release # set today's date in VERSION
```

`make run` starts a temporary backend as `app:80` for the bundled VCL.

## Maintenance

See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to [support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package.
See [how to contribute](https://github.com/dockette/.github/blob/master/CONTRIBUTING.md) to this package. Consider to
[support](https://github.com/sponsors/f3l1x) **f3l1x**. Thank you for using this package.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2026.10.23
VERSION=2026.10.23
Loading