Public repository for ragedunicorn docker container-test images
3.2K

A lightweight Google Container Structure Test installation on Alpine Linux for automated Docker image validation.
# Pull latest version
docker pull ragedunicorn/container-test:latest
# Or pull specific version (see the Tags tab for the available versions)
docker pull ragedunicorn/container-test:<container-test-version>-alpine<alpine-version>-<build>
# Run tests on an image
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/test:/test \
ragedunicorn/container-test:latest --image nginx:latest --config /test/nginx_test.yml
File Tests: Verify file/directory existence and content
Command Tests: Execute commands and validate outputs
Metadata Tests: Check labels, exposed ports, volumes, and other image properties
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/test:/test \
ragedunicorn/container-test:latest --image myapp:latest --config /test/app_test.yml
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/test:/test \
ragedunicorn/container-test:latest --pull --image myapp:latest --config /test/app_test.yml
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/test:/test \
ragedunicorn/container-test:latest --platform linux/arm64 --image myapp:latest --config /test/app_test.yml
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/test:/test \
ragedunicorn/container-test:latest --image myapp:latest --config /test/app_test.yml \
--output json --test-report /test/report.json
Create a test file (e.g., test/app_test.yml):
schemaVersion: 2.0.0
fileExistenceTests:
- name: 'App binary exists'
path: '/usr/local/bin/app'
shouldExist: true
commandTests:
- name: 'App version check'
command: 'app'
args: ['--version']
expectedOutput: ['1.0.0']
exitCode: 0
metadataTest:
labels:
- key: 'version'
value: '1.0.0'
exposedPorts: ['8080']
This image uses semantic versioning that includes all component versions:
Format: {container-structure-test_version}-alpine{alpine_version}-{build_number}
X.Y.Z is the Container Structure Test version, A.B.C the Alpine version:
X.Y.Z-alpineA.B.C-1 - Container Structure Test X.Y.Z on Alpine A.B.C, build 1X.Y.Z-alpineA.B.C-2 - Rebuild of same versions (bug fixes, optimizations)X.Y.Z-alpineA.B.D-1 - Alpine Linux patch updateX.Y+1.0-alpineA.B.C-1 - Container Structure Test version updatelatest - Most recent stable releaseThe available versions are listed in the Tags tab.
docker run -v //var/run/docker.sock:/var/run/docker.sock -v ${PWD}/test:/test \
ragedunicorn/container-test:latest --image myapp:latest --config /test/app_test.yml
docker run -v /var/run/docker.sock:/var/run/docker.sock -v $(pwd)/test:/test \
ragedunicorn/container-test:latest --image myapp:latest --config /test/app_test.yml
MIT License - See GitHub repository for details.
Content type
Image
Digest
sha256:7497230ef…
Size
23.3 MB
Last updated
18 days ago
docker pull ragedunicorn/container-test