CheckOps
Container Structure Test
Container Structure Test is an Apache-2.0 tool from Google for validating the structure of container images: commands, file contents, metadata and existence checks defined in YAML.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
Container Structure Test validates the structure of a container image. A YAML config lists checks of four kinds: command tests that run a command in the image and assert on output and exit code, file existence tests, file content tests, and metadata tests for environment variables, entrypoint, exposed ports, labels and user.
It runs against images through Docker or other drivers and fits naturally after the image build step in CI. Typical uses are confirming that a binary is on the path, that a config file contains the right setting, or that the image runs as a non-root user.
In the quality loop it is an integration gate for images, alongside linters such as Hadolint and scanners such as Trivy.
The source code is at GoogleContainerTools/container-structure-test on GitHub under the Apache-2.0 licence, with about 2,500 stars; the most recent commit was on 15 April 2026.
Features
- Command tests: Run commands and assert output.
- File existence: Check paths and permissions.
- File content: Match expected content with regex.
- Metadata tests: Entrypoint, env, ports, labels, user.
- Drivers: Docker and other runtimes.
- JUnit output: For CI reporting.
Pros
- Focused: Simple checks that are easy to read.
- Free to use: Open source under the Apache-2.0 licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 15 April 2026.
Cons
- Slow release cadence: Releases are infrequent.
- Image only: Does not test running services together.
- YAML-limited: No complex logic.
Usage and Links (Example)
schemaVersion: 2.0.0
commandTests:
- name: app runs
command: /app/server
args: ["--version"]
expectedOutput: ["v\\d+"]
metadataTest:
user: "10001"
container-structure-test test --image myapp:test --config cst.yaml
Resources:
Pricing
Container Structure Test is free and open source under the Apache-2.0 licence.
Recommended for?
- Teams publishing base images that need guarantees about contents.
- CI pipelines checking images before push.
Conclusion
Container Structure Test is a small, dependable gate for image contents and metadata.
Add it right after the build step.
On CheckOps, Container Structure Test is filed under the Integration testing and Release & CI gates stages. Related tools listed here include Goss, Hadolint, Trivy, Dockle, Terratest and Test Kitchen. Which one fits best depends mostly on your stack, your team’s size and skills, and whether you prefer to run tools yourself or pay for a managed service. This page reflects the official website, documentation and repository as they stood on 11 November 2026.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with Container Structure Test side by side.
GGossGoss is an Apache-2.0 YAML-based tool for quick server and container validation, checking packages, files, ports, services and HTTP endpoints, with dgoss for Docker images.Compare with Container Structure Test
HHadolintHadolint is a GPL-3.0 Dockerfile linter written in Haskell that checks best practices and validates inline bash in RUN instructions using ShellCheck.Compare with Container Structure Test
TTrivyTrivy is Aqua Security's Apache-2.0 all-in-one scanner for container images, filesystems, Git repos, VM images and Kubernetes, finding CVEs, IaC misconfigurations, secrets, licences and SBOM data.Compare with Container Structure Test
DDockleDockle is an Apache-2.0 container image linter for security that checks built images against best practices and CIS Docker Benchmark items.Compare with Container Structure Test
TTerratestTerratest is an Apache-2.0 Go library from Gruntwork for writing automated tests that deploy real Terraform, Packer, Docker and Kubernetes infrastructure, validate it and tear it down.Compare with Container Structure Test
TTest KitchenTest Kitchen is an Apache-2.0 integration testing harness that converges infrastructure code on isolated platforms such as Docker, Vagrant and cloud VMs, then runs verifiers like InSpec.Compare with Container Structure Test