Sign inSign up
container-test logo

ragedunicorn/container-test

By ragedunicorn

•Updated 18 days ago

Public repository for ragedunicorn docker container-test images

Image
Integration & delivery
Developer tools
0

3.2K

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 (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

⁠Features

  • 🚀 Small footprint: Minimal Alpine Linux base image
  • 📦 Container Structure Test: Pinned upstream release, kept current by Renovate
  • 🔍 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

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 1
  • X.Y.Z-alpineA.B.C-2 - Rebuild of same versions (bug fixes, optimizations)
  • X.Y.Z-alpineA.B.D-1 - Alpine Linux patch update
  • X.Y+1.0-alpineA.B.C-1 - Container Structure Test version update
  • latest - Most recent stable release

The available versions are listed in the Tags tab⁠.

⁠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:7497230ef…

Size

23.3 MB

Last updated

18 days ago

docker pull ragedunicorn/container-test