container-test
Public repository for ragedunicorn docker container-test images
1.8K

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
docker pull ragedunicorn/container-test:1.19.3-alpine3.22.1-1
# 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}
1.19.3-alpine3.22.1-1 - Initial release with Container Structure Test 1.19.3 and Alpine 3.22.11.19.3-alpine3.22.1-2 - Rebuild of same versions (bug fixes, optimizations)1.19.3-alpine3.22.2-1 - Alpine Linux patch update1.20.0-alpine3.22.1-1 - Container Structure Test version updatedocker 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:85f00539d…
Size
22.7 MB
Last updated
about 1 month ago
docker pull ragedunicorn/container-test