Automate DockerMenu

Automate

Docker

The image is about 17 MB: a static binary on a distroless base, running as a non-root user. It supports linux/amd64 and linux/arm64, and is published in two places with the same digest:

Registry Image
GitHub Container Registry ghcr.io/ityashag/infraglass
Docker Hub yashcse21/infraglass (docker.io/yashcse21/infraglass)

Tags: latest, each release (0.2.3) and each minor line (0.2). The examples use GHCR; swap in the Docker Hub name if you prefer.

Play with the demo

docker run --rm -p 127.0.0.1:7788:7788 ghcr.io/ityashag/infraglass

Open the link printed in the logs. It carries the session token.

Your own state

The image doesn't include Terraform. Give it the JSON from terraform show -json:

terraform show -json > state.json
docker run --rm -p 127.0.0.1:7788:7788 -v "$PWD:/work:ro" \
  ghcr.io/ityashag/infraglass serve --state /work/state.json

For plans, use terraform show -json tfplan > plan.json and serve --plan /work/plan.json. To watch applies, record on the host and mount the runs directory:

terraform apply -json tfplan | infraglass record --dir runs
docker run --rm -p 127.0.0.1:7788:7788 -v "$PWD:/work:ro" \
  ghcr.io/ityashag/infraglass serve --state /work/state.json --follow /work/runs

Compose

The repository has a compose.yaml. It runs a read-only, capability-free container on 127.0.0.1:7788 that serves ./state.json and watches ./runs:

docker compose up
docker compose logs viewer   # for the link

How the container is set up

Inside a container, the viewer has to listen on all interfaces to be reachable. The image sets:

Variable Value Same as
INFRAGLASS_ADDR 0.0.0.0 --addr 0.0.0.0
INFRAGLASS_ALLOW_REMOTE true --allow-remote
INFRAGLASS_NO_OPEN true --no-open

Flags on the command line win over these.

Important

Always publish the port to 127.0.0.1 (-p 127.0.0.1:7788:7788), as in the examples, so only your machine can reach it. The session token, Host checks and read-only API still apply.

The image also has a HEALTHCHECK (infraglass healthcheck) and runs well with --read-only --cap-drop ALL --security-opt no-new-privileges.

Pin and verify the image

For anything you rely on, use a release tag (or its digest) rather than latest. Each image has signed build provenance from the release workflow, which the GitHub CLI can check:

docker pull ghcr.io/ityashag/infraglass:0.2.3
gh attestation verify oci://ghcr.io/ityashag/infraglass:0.2.3 -R ityashag/infraglass

The Docker Hub copy has the same digest, so the same check passes for oci://docker.io/yashcse21/infraglass:0.2.3.

Improve this page on GitHub · Report a problem