- Nix 100%
ci-cache
Squid-based caching proxy for container image pulls, Nix binary cache, and general HTTPS traffic. Includes SSL-bump for transparent HTTPS proxying and store_id-based deduplication of signed CDN blob URLs.
The container image is built with Nix (nix build .#container-image)
and deployed via kustomize.
Status - Experimental
I use this only in my lab to accelerate machine re-builds and container image fetches.
Some kustomize manifests still reference a private GitLab registry. These need to be updated once container images are published on Codeberg.
Usage
Deploy via kustomize, referencing a tagged version or a commit hash:
resources:- https://gitlab.gitlab.k0s.lab.bo-tech.de/bv/charts/ci-cache.git//kustomize/overlays/full?ref=v0.9.0The base deployment requires a squid-ca Secret with tls.crt and
tls.key for SSL-bump certificate generation. The cert-manager-ca
component can provision this automatically.
Kustomize
The kustomize/ directory contains a reusable base and optional components:
kustomize/
base/ # Squid deployment, service, PVC, config
components/
ca-serve/ # Serves the CA cert over HTTP
cert-manager-ca/ # Provisions the CA Secret via cert-manager
refresh-patterns/ # Caching rules for registries, Nix cache, CDN blobs
store-id/ # Store ID rewriting for signed CDN URL dedup
overlays/
full/ # Base + all components
test/ # Fast iteration — emptyDir cache, debug logging
Consume via remote kustomize reference:
resources:- https://gitlab.example.com/bv/charts/ci-cache.git//kustomize/base?ref=v0.9.0components:- https://gitlab.example.com/bv/charts/ci-cache.git//kustomize/components/cert-manager-ca?ref=v0.9.0Or use the overlays/full overlay which includes everything.
Building the container image
No pre-built images are available yet. Build locally with Nix:
nix build .#container-image
# Stream directly into a registry
./result | skopeo copy docker-archive:/dev/stdin docker://registry.example.com/squid:v0.9.0
# Or save to a file first
./result > squid.tar
Contact
Pointers
- Squid HTTP proxy - http://www.squid-cache.org/
- Squid
store_id- http://www.squid-cache.org/Doc/config/store_id_program/