Check Image is available as a multi-architecture Docker image from GitHub Container Registry. The Docker image allows you to validate container images in any environment that supports Docker, without needing to install the binary locally.
The Docker image validates remote registry images by default. No Docker socket mount is required:
# Check image agedocker run --rm ghcr.io/jarfernandez/check-image age nginx:latest --max-age 30# Check image sizedocker run --rm ghcr.io/jarfernandez/check-image size nginx:latest --max-size 100# Check for root userdocker run --rm ghcr.io/jarfernandez/check-image root-user nginx:latest# Run all checks with JSON outputdocker run --rm ghcr.io/jarfernandez/check-image all nginx:latest -o json
# Mount a local config directory (read-only)docker run --rm \ -v "$(pwd)/config:/config:ro" \ ghcr.io/jarfernandez/check-image registry nginx:latest \ --registry-policy /config/registry-policy.json
# Run all checks with a config filedocker run --rm \ -v "$(pwd)/config:/config:ro" \ ghcr.io/jarfernandez/check-image all nginx:latest \ --config /config/config.yaml
By default, Check Image validates remote registry images without requiring access to the Docker daemon. This is the recommended approach for security.However, you can validate local Docker images by mounting the Docker socket:
Security Warning: Mounting the Docker socket grants the container full access to the Docker daemon, which is equivalent to root access on the host. Only use this in trusted environments.
# Validate a local image (requires Docker socket)docker run --rm \ -v /var/run/docker.sock:/var/run/docker.sock \ ghcr.io/jarfernandez/check-image age my-local-image:latest --max-age 30
Mount your Docker config file to use existing credentials:
# Login to registry on hostdocker login my-registry.example.com# Mount Docker config into containerdocker run --rm \ -v ~/.docker/config.json:/home/nonroot/.docker/config.json:ro \ ghcr.io/jarfernandez/check-image age my-registry.example.com/private-image:latest
# Using Personal Access Tokendocker run --rm \ -e CHECK_IMAGE_USERNAME=github-username \ -e CHECK_IMAGE_PASSWORD=ghp_your_token_here \ ghcr.io/jarfernandez/check-image age ghcr.io/myorg/private-app:latest
# Pin to specific version in productiondocker run --rm ghcr.io/jarfernandez/check-image:0.19.4 age nginx:latest# Use major version tag (auto-updates to latest patch)docker run --rm ghcr.io/jarfernandez/check-image:0 age nginx:latest# Use major.minor version tagdocker run --rm ghcr.io/jarfernandez/check-image:0.19 age nginx:latest
The Docker image automatically pulls the correct architecture for your platform:
# On amd64 (Intel/AMD)docker run --rm ghcr.io/jarfernandez/check-image version# Uses linux/amd64 image# On arm64 (Apple Silicon, ARM servers)docker run --rm ghcr.io/jarfernandez/check-image version# Uses linux/arm64 image
# Force amd64 platformdocker run --rm --platform linux/amd64 \ ghcr.io/jarfernandez/check-image age nginx:latest# Force arm64 platformdocker run --rm --platform linux/arm64 \ ghcr.io/jarfernandez/check-image age nginx:latest
# Ensure mounted files are readablechmod 644 ./config/*.yaml# Verify volume mount pathdocker run --rm -v "$(pwd)/config:/config:ro" \ ghcr.io/jarfernandez/check-image ls /config