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
Setting Up DockerHub Token
- Log in to DockerHub
- Go to Account Settings → Security
- Create new access token with read/write permissions
- Add token to GitHub repository secrets
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
- Checkout source code and setup build environment
- Build multi-architecture Docker images
- Run security scans on container images
- Login to both GHCR and DockerHub registries
- Push images with appropriate tags to both registries
- 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.