Docker Setup

Automated Docker container publishing to GitHub Container Registry and DockerHub.

Overview

This project automatically publishes Docker containers to both GitHub Container Registry (GHCR) and DockerHub when a new release is created. The containers provide a portable way to run HTTP File Runner without installing dependencies.

Supported Platforms

  • Linux AMD64: Standard x86_64 architecture
  • Linux ARM64: ARM-based systems (Apple M1/M2, AWS Graviton)
  • Multi-arch images: Automatic platform detection

Container Registries

The project publishes to two major container registries for maximum accessibility.

GitHub Container Registry (GHCR)

# Pull from GitHub Container Registry docker pull ghcr.io/christianhelle/httprunner:latest # Run with GitHub Container Registry image docker run --rm -v ${PWD}:/workspace ghcr.io/christianhelle/httprunner:latest *.http

DockerHub

# Pull from DockerHub docker pull christianhelle/httprunner:latest # Run with DockerHub image docker run --rm -v ${PWD}:/workspace christianhelle/httprunner:latest *.http

Registry Features

  • GHCR: Integrated with GitHub, supports private repos, excellent for CI/CD
  • DockerHub: Most popular registry, great for public distribution
  • Both: Support multi-architecture images and vulnerability scanning

Required Secrets

The following repository secrets must be configured for automated publishing.

GitHub Secrets Configuration

GITHUB_TOKEN
Auto-provided
Automatically provided by GitHub Actions for GHCR authentication
DOCKERHUB_USERNAME
string
DockerHub username for authentication
DOCKERHUB_TOKEN
string
DockerHub access token (not password) for secure authentication

Setting Up DockerHub Token

  1. Log in to DockerHub
  2. Go to Account Settings → Security
  3. Create new access token with read/write permissions
  4. Add token to GitHub repository secrets

Container Tags

Images are tagged automatically based on the release version and additional metadata.

Tagging Strategy

latest
Always points to the most recent stable release
v1.2.3
Specific version tag for reproducible deployments
v1.2
Minor version tag for compatible updates
v1
Major version tag for stability

Image Metadata

All images include comprehensive metadata for better discoverability and maintenance:

  • Source repository and commit SHA
  • Build timestamp and version
  • License and description
  • Maintainer information

Usage

Multiple ways to use HTTP File Runner containers for different scenarios.

Basic Usage

# Run single HTTP file docker run --rm -v ${PWD}:/workspace httprunner:latest requests.http # Run with verbose output docker run --rm -v ${PWD}:/workspace httprunner:latest --verbose requests.http # Discover and run all HTTP files docker run --rm -v ${PWD}:/workspace httprunner:latest --discover

Advanced Usage

# Use specific environment docker run --rm -v ${PWD}:/workspace httprunner:latest --env production api-tests.http # Save logs to file docker run --rm -v ${PWD}:/workspace httprunner:latest --log test-results.log --discover # Custom working directory docker run --rm -v ${PWD}/tests:/workspace httprunner:latest *.http

CI/CD Integration

# GitHub Actions example - name: Run HTTP tests run: | docker run --rm -v ${{ github.workspace }}:/workspace \ ghcr.io/christianhelle/httprunner:latest \ --discover --log results.log # Docker Compose example version: '3.8' services: api-tests: image: christianhelle/httprunner:latest volumes: - ./tests:/workspace command: ["--discover", "--verbose"]

Workflow Trigger

Container publishing is automated through GitHub Actions workflows.

Trigger Conditions

  • Release Creation: New GitHub release triggers container build
  • Tag Push: Version tags (v*.*.*) trigger publishing
  • Manual Trigger: Workflow can be run manually from Actions tab

Build Process

  1. Checkout source code and setup build environment
  2. Build multi-architecture Docker images
  3. Run security scans on container images
  4. Login to both GHCR and DockerHub registries
  5. Push images with appropriate tags to both registries
  6. Update container registry metadata

Security Scanning

All container images undergo security scanning before publication:

  • Trivy scanning: Vulnerability detection in base images and dependencies
  • Best practices: Dockerfile security recommendations
  • Supply chain: Verification of build reproducibility

Note: Container images are only published for official releases to ensure stability and security.