ragedunicorn/container-test

By ragedunicorn

Updated about 1 month ago

Public repository for ragedunicorn docker container-test images

Image
Integration & delivery
Developer tools
0

1.8K

ragedunicorn/container-test repository overview

Container Structure Test Alpine Docker Image

Docker Container Test

A lightweight Google Container Structure Test installation on Alpine Linux for automated Docker image validation.

Quick Start

# 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

Features

  • 🚀 Small footprint: Minimal Alpine Linux base image
  • 📦 Container Structure Test v1.19.3: Latest stable version
  • 🔍 Comprehensive testing: Validate file existence, command outputs, and metadata
  • 🏗️ Multi-platform: Supports linux/amd64 and linux/arm64
  • 🐳 Docker-in-Docker: Tests images through Docker socket mounting

Test Types

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

Usage Examples

Test file existence
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
Run with auto-pull
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
Test specific platform
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
Generate test report
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

Sample Test Configuration

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']

Tags

This image uses semantic versioning that includes all component versions:

Format: {container-structure-test_version}-alpine{alpine_version}-{build_number}

Version Examples
  • 1.19.3-alpine3.22.1-1 - Initial release with Container Structure Test 1.19.3 and Alpine 3.22.1
  • 1.19.3-alpine3.22.1-2 - Rebuild of same versions (bug fixes, optimizations)
  • 1.19.3-alpine3.22.2-1 - Alpine Linux patch update
  • 1.20.0-alpine3.22.1-1 - Container Structure Test version update

Platform Support

Windows
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
Linux/macOS
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

License

MIT License - See GitHub repository for details.

Tag summary

Content type

Image

Digest

sha256:85f00539d

Size

22.7 MB

Last updated

about 1 month ago

docker pull ragedunicorn/container-test