This directory contains Docker configuration files for running the WebAssembly benchmark project in a containerized environment.
Dockerfile- Multi-stage Docker build configurationdocker-compose.yml- Docker Compose configuration for easy container managementscripts/docker-run.sh- Convenience script for running common commands.dockerignore- Files to exclude from Docker build context
- Docker (20.10+)
- Docker Compose (2.0+)
# Run the complete benchmark pipeline
./scripts/docker-run.sh full
# Or step by step:
./scripts/docker-run.sh start # Build and start container
./scripts/docker-run.sh init # Initialize environment
./scripts/docker-run.sh build # Build WebAssembly modules
./scripts/docker-run.sh run # Run benchmarks
./scripts/docker-run.sh analyze # Run analysis# Enter container for development
./scripts/docker-run.sh shell./scripts/docker-run.sh helpThe Dockerfile uses a multi-stage build approach:
- Builder Stage: Installs all development tools and dependencies
- Runtime Stage: Contains only the necessary runtime components
This approach significantly reduces the final image size while maintaining full functionality.
The following directories are mounted as volumes to persist data:
./results- Benchmark test results./reports- Analysis reports and plots./builds- WebAssembly build artifacts
The container includes specific versions of all required tools:
- Rust: 1.90.0
- TinyGo: 0.39.0
- Go: 1.25.1
- Node.js: 22.20.0
- Python: 3.12.3
If the build fails, try cleaning the Docker cache:
./scripts/docker-run.sh clean
./scripts/docker-run.sh startThe container runs as a non-root user benchmark. If you encounter permission issues with mounted volumes, ensure the host directories have appropriate permissions.
The container is configured with memory limits. If you need more resources, adjust the limits in docker-compose.yml.
- Make changes to source code on host
- Run
./scripts/docker-run.sh buildto rebuild WebAssembly modules - Run
./scripts/docker-run.sh run quickfor fast testing - Access results in
./resultsand./reportsdirectories
This Docker setup is designed to work well with CI/CD pipelines. The containerized environment ensures consistent builds across different systems.