Minimal Dev Container image with OpenTofu: Debian, verified upstreams, SLSA provenance
8.3K
Mirror. This Docker Hub repository mirrors
ghcr.io/bare-devcontainer/opentofu, under the same tags and with the same digests. GitHub Container Registry receives every build first and applies no pull rate limit, so preferghcr.io/bare-devcontainer/opentofuunless your environment requires Docker Hub, where the image isdocker.io/baredevcontainer/opentofu.This page is rendered from the image's README in bare-devcontainer/images. That is the repository "this repository" refers to below.
Dev container image for infrastructure-as-code development, with the OpenTofu CLI and tofu-ls language server installed, built on the debian base image.
Like every image in this repository, it is minimal, built only from upstreams verified at build
time, and published with SLSA provenance, a GitHub artifact attestation, and an SBOM; it runs as
the non-root user dev. Why these images explains the
reasoning, and Verifying the image below shows how to check a build.
ghcr.io/bare-devcontainer/opentofu:<tag>
Reference it from .devcontainer/devcontainer.json, pinning the digest as well as the tag:
{
"image": "ghcr.io/bare-devcontainer/opentofu:1@sha256:<digest>"
}
A ready-to-use Dev Container template for this image is available at bare-devcontainer/templates. It provides the recommended configuration for this image, including security hardening and volume mounts that persist cache directories for faster rebuilds.
| Tags | Debian variant |
|---|---|
1.12.6-trixie, 1-trixie, 1.12.6, 1, trixie | trixie |
1.12.6-bookworm, 1-bookworm, bookworm | bookworm |
Tags are also published with a date suffix on each build (e.g., 1.12.6-trixie-<YYYYMMDD>).
Everything from the debian base image, plus:
Under a Dev Container client, TF_PLUGIN_CACHE_DIR points at ~/.terraform.d/plugin-cache, so
providers are downloaded once and shared across working directories. Persisting that directory
as a volume keeps them across container rebuilds. Running the image without such a client
(docker run, a CI job's container:) leaves the variable unset.
aws, gcloud, and az are absent. Add the one the project
needs through a Dev Container Feature or your own Dockerfile.terragrunt, tflint, tfsec, and similar are left to
the project.tofu is downloaded directly from the
OpenTofu release page. Its checksum is verified against
its SHA256SUMS, whose GPG signature (SHA256SUMS.gpgsig) is verified against OpenTofu's release signing
key before installation. The key (opentofu/opentofu-signing-key.asc) is committed to this
repository, so signatures are checked against a key reviewed here rather than one fetched at
build time.
tofu-ls publishes no signature, so its checksums.txt (opentofu/tofu-ls-checksums.txt) is
committed to this repository instead and refreshed whenever the pinned version changes. The
archive is verified against that reviewed copy rather than the one served from its own release.
Note that this covers the CLI. Providers that tofu init downloads at runtime come from the
OpenTofu Registry under OpenTofu's own checksum and signature verification, outside this
image's build pipeline.
Every build is published with SLSA provenance, a GitHub artifact attestation, and an SBOM. The attestation confirms that an image was built by the release workflow of this repository and has not been altered since:
gh attestation verify oci://ghcr.io/bare-devcontainer/opentofu:<tag>@sha256:<digest> \
--owner bare-devcontainer
The Docker Hub mirror carries the same digests, so the same command verifies an image pulled
from docker.io/baredevcontainer/opentofu.
Verifying Published Images covers inspecting the
provenance and the SBOM as well.
Content type
Image
Digest
sha256:58332bfb0…
Size
271.6 MB
Last updated
4 days ago
docker pull baredevcontainer/opentofu:1.12.6-bookworm-20260923