Docker
cache-detective is published on Docker Hub and GHCR. The entrypoint is the cache-detective binary itself, so any CLI command works after the image name.
Quick start
Section titled “Quick start”docker run --rm ghcr.io/cerberauth/cache-detective scan --url https://example.com/docker run --rm cerberauth/cache-detective scan --url https://example.com/Mounting a list file, sitemap output, or a .har import
Section titled “Mounting a list file, sitemap output, or a .har import”Commands that read a local file (--list, --har) need that file inside the container. Mount the containing directory as a volume and reference the in-container path:
docker run --rm -v "$(pwd)":/data ghcr.io/cerberauth/cache-detective \ scan --list /data/urls.txtdocker run --rm -v "$(pwd)":/data ghcr.io/cerberauth/cache-detective \ scan --har /data/session.harProbing a live server
Section titled “Probing a live server”docker run --rm ghcr.io/cerberauth/cache-detective \ scan --url https://staging.example.com/ --aggressiveWhen probing a server running in another container, join its network:
docker run --rm --network container:api ghcr.io/cerberauth/cache-detective \ scan --url http://localhost:8080/Docker Compose
Section titled “Docker Compose”Run cache-detective as a one-off step alongside a service under test:
services: api: build: . ports: - '8080:8080'
cache-detective: image: ghcr.io/cerberauth/cache-detective depends_on: - api command: ['scan', '--url', 'http://api:8080/']docker compose run --rm cache-detectiveBuild from source
Section titled “Build from source”-
Clone the repository:
Terminal window git clone https://github.com/cerberauth/cache-detective.gitcd cache-detective -
Build the image using the dev Dockerfile:
Terminal window docker build -f .docker/Dockerfile-build -t cache-detective . -
Run it:
Terminal window docker run --rm cache-detective scan --url https://example.com/
GitHub Actions
Section titled “GitHub Actions”To run cache-detective in CI, see the GitHub Actions guide. To use the container image directly in a workflow step:
- name: Scan for cache misconfigurations run: docker run --rm ghcr.io/cerberauth/cache-detective scan --url https://staging.example.com/ --output-format json --output report.json