π³ FLUX Fleet Containers
Docker-based agent containerization for the FLUX Fleet β reproducible deployments, isolated execution, standardized tooling.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FLUX FLEET NETWORK β
β (172.28.0.0/16 β bridge) β
β β
β ββββββββββββββββ ββββββββββββββββββββββββββββββββββββ β
β β ORACLE-1 β β FLUX RUNTIME β β
β β (coordinator)β β FastAPI / Uvicorn :8080 β β
β β 172.28.0.10 β β 172.28.0.20 β β
β β CPU: 2.0 β β Health: 15s interval β β
β β MEM: 2G β ββββββββββββββββ¬ββββββββββββββββββββ β
β ββββββββ¬ββββββββ β β
β β β β
β depends_on runtime API β
β β β β
β ββββββββ΄ββββββββββββββββββββββββββββ΄βββββββββββββββββββ β
β β AGENT LAYER β β
β β β β
β β ββββββββββββ ββββββββββββ βββββββββββββββββ β β
β β β VESSEL-1 β β VESSEL-2 β β GREENHORN-1 β β β
β β β .31 β β .32 β β .41 β β β
β β β 1.5 CPU β β 1.5 CPU β β 1.0 CPU β β β
β β β 1G MEM β β 1G MEM β β 1G MEM β β β
β β ββββββββββββ ββββββββββββ βββββββββββββββββ β β
β β ββββββββββββββββββ β
β β β GREENHORN-2 ββ β
β β β .42 ββ β
β β β 1.0 CPU ββ β
β β β 1G MEM ββ β
β β ββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β SHARED VOLUMES β β
β β π fleet-data β π fleet-logs β π secrets β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Image Hierarchy:
βββββββββββββββ
β Dockerfile β β Python 3.11 + Go 1.21 + Node 20 + Rust
β .base β
ββββββββ¬βββββββ
β
ββββββ΄ββββββββββββββ
βΌ βΌ
ββββββββββββ ββββββββββββββββ
βDockerfileβ β Dockerfile β
β.flux- β β .agent β
β runtime β β + git + gh β
ββββββββββββ ββββββββββββββββ
Docker 20.10+
Docker Compose v2+
Python 3.11+ (for tests)
GitHub PAT (for agent git operations)
git clone https://github.com/SuperInstance/fleet-containers.git
cd fleet-containers
# Set your GitHub token
export GITHUB_TOKEN=" ghp_your_token_here"
make logs # Stream all fleet logs
make ps # Show running containers
make health # Check health status
Image
Dockerfile
Purpose
Base
fleet/base
Dockerfile.base
Multi-language runtime
ubuntu:22.04
fleet/runtime
Dockerfile.flux-runtime
FLUX VM execution
python:3.11-slim
fleet/agent
Dockerfile.agent
Generic agent with git/gh
python:3.11-slim
Python 3.11 β Agent scripting, health checks, testing
Go 1.21 β High-performance fleet tooling
Node.js 20 β JavaScript/TypeScript agent tasks
Rust (stable) β Systems-level agent components
Git, GitHub CLI (gh)
Python packages: requests, pyyaml, pytest, docker, gitpython, rich, click, pydantic
Entrypoint with agent bootstrap logic
π§ Environment Variables
Common Variables (all containers)
Variable
Default
Description
FLEET_ORG
SuperInstance
GitHub organization for fleet repos
LOG_LEVEL
info
Logging level (debug, info, warn, error)
GIT_USER_NAME
Super Z
Git commit author name
GIT_USER_EMAIL
superz@flux.fleet
Git commit author email
Variable
Default
Description
AGENT_NAME
flux-agent
Unique agent identifier
AGENT_ROLE
greenhorn
Agent role (oracle, vessel, greenhorn)
GITHUB_TOKEN
(empty)
GitHub PAT for git operations
AGENT_REPOS
(empty)
Comma-separated list of repos to clone
AGENT_WORKSPACE
/home/agent/workspace
Agent working directory
Variable
Default
Description
FLUX_RUNTIME_PORT
8080
Runtime API port
FLUX_LOG_LEVEL
info
Runtime-specific log level
FLUX_VM_HOME
/opt/flux-vm
VM installation directory
GRACE_PERIOD
10
Shutdown grace period (seconds)
Target
Description
make help
Show all available targets
make build-all
Build all Docker images
make up
Start the full fleet
make down
Stop the fleet
make restart
Restart the fleet
make test
Run all tests
make health
Check container health
make shell
Shell into running agent
make clean-all
Remove containers, images, and volumes
make lint
Lint Dockerfiles and compose file
The test suite contains 72 tests covering:
Dockerfile validation (T01βT19) β Syntax, instructions, labels, security
Compose validation (T20βT32) β Services, networks, dependencies, resources
Entrypoint validation (T33βT41) β Git config, auth, agent modes, error handling
Health check validation (T42βT52) β Script execution, modes, JSON output
Network validation (T53βT60) β Driver, IPAM, subnets, labels
Makefile validation (T61βT67) β Build targets, clean, test
Project structure (T68βT72) β File existence, no secrets
# Run all tests
make test
# Run only unit tests
make test-unit
# Verbose output
make test-verbose
π Security Considerations
Never commit GitHub PATs to the repository
Pass tokens via environment variables or Docker secrets
The .gitignore excludes .env files
Tests verify no hardcoded secrets (T72)
Runtime containers run as non-root (flux / agent users)
Each agent has its own container with resource limits
Inter-agent communication only via fleet-internal bridge network
No host port exposure except runtime API (8080)
Bridge network isolates fleet from host network
Static IP assignment prevents address hijacking
DNS resolution is verified by health checks
No privileged mode or capabilities granted
Use slim variants where possible
Pin language versions to prevent supply-chain drift
Layer caching optimized with proper ordering
No build-time secrets in image layers
Base images from official Docker Hub libraries
PPA/deb repos from trusted sources only
rustup verified via TLS (https://sh.rustup.rs)
fleet-containers/
βββ Dockerfile.base # Multi-language base image
βββ Dockerfile.flux-runtime # FLUX VM runtime container
βββ Dockerfile.agent # Generic agent container
βββ docker-compose.yml # Multi-agent fleet orchestration
βββ fleet-network.yml # Network and volume configuration
βββ entrypoint.sh # Agent bootstrap script
βββ healthcheck.py # Container health monitoring
βββ Makefile # Build, run, test targets
βββ README.md # This file
βββ scripts/
β βββ vm-bootstrap.sh # VM initialization
β βββ vm-shutdown.sh # VM graceful shutdown
βββ tests/
βββ test_containers.py # 72 test cases
FLUX Fleet β SuperInstance
Built with π by Super Z