Container Lifecycle
Container instances in GZCTF progress through several states:Container Status
- Pending
- Running
- Destroyed
Container is being created
- Initial state when instance is requested
- Platform is pulling image and starting container
- Waiting for container to be ready
Container Properties
Core Attributes
Entry Point
How users access the container depends on the network configuration:- Reverse Proxy
- Direct Access
Traffic routed through GZCTF proxyBenefits:
- No need to expose ports
- Built-in traffic capture support
- Better security and isolation
Orchestration Platforms
GZCTF supports two container orchestration platforms:Docker Provider
Docker Engine
Recommended for single-server deployments and testing
- Direct Docker API communication
- Simple setup and configuration
- Port mapping for direct access
- User-defined networks support
Kubernetes Provider
Kubernetes
Recommended for production and multi-server deployments
- Horizontal scaling across nodes
- Advanced resource management
- High availability
- Network policies and custom labels
Resource Limits
Each container challenge defines resource constraints:| Resource | Property | Default | Description |
|---|---|---|---|
| Memory | MemoryLimit | 64 MB | RAM allocation |
| Storage | StorageLimit | 256 MB | Disk space |
| CPU | CPUCount | 1 (0.1 CPU) | CPU cores in 0.1 units |
| Port | ExposePort | 80 | Container port to expose |
Example Resource Configuration
Network Modes
Containers can operate in different network isolation modes:- Open
- Isolated
- Custom
Full internet access
- Container can access external networks
- Can download files from the internet
- Suitable for challenges requiring external connectivity
Instance Management
Per-Team Limits
Games enforce concurrent container limits per team:- Default: 3 simultaneous containers
- Teams must destroy instances to start new ones
- Prevents resource exhaustion
Lifetime Management
The 2-hour default prevents immediate destruction after creation. Actual destruction time is managed by the container manager based on platform configuration.
Traffic Capture
GZCTF supports capturing network traffic for container instances:Capture Storage
Traffic captures are stored with the following path structure:ChallengeId: Identifies the challengeParticipationId: Identifies the teamShortId: First 12 characters of container GUIDconn: Connection identifier
Traffic capture requires reverse proxy mode (
IsProxy = true) and is only supported for web-based challenges.Container Metadata
Containers can generate metadata for logging and tracking:- Game Instance
- Exercise Instance
Container Instances
GZCTF distinguishes between two types of container instances:GameInstance
Competition challenge containers- Associated with a game participation
- Counts toward team’s container limit
- Subject to game timing constraints
- Tracked for scoring and events
ExerciseInstance
Practice/training containers- Independent of games
- Personal practice environment
- Not subject to competition rules
- User-specific (not team-based)
Container Model Reference
The Container model is located at:View Complete Container Model
View Complete Container Model
Best Practices
Resource Allocation
Resource Allocation
- Set appropriate memory limits to prevent OOM kills
- Use isolated network mode for pwn challenges
- Limit CPU to prevent resource hogging
- Monitor container counts per team
Image Management
Image Management
- Use specific image tags (not
latest) - Test containers before deploying to competition
- Include flag placeholders in Dockerfile ENV
- Minimize image size for faster startup
Security
Security
- Use isolated network mode when possible
- Set appropriate resource limits
- Regularly update base images
- Enable traffic capture for monitoring
Performance
Performance
- Pre-pull images before competition starts
- Use local registry for faster pulls
- Set appropriate
ExpectStopAttimes - Monitor container manager health
Related Topics
Challenges
Configure container-based challenges
Dynamic Flags
Learn about flag generation in containers
Games
Manage container limits and game configuration
Teams
Understand team instance management