# Build and start the container
docker-compose up -d
# Enter the container
docker-compose exec network-control-plane bash
# Now you can run commands inside the container
python3 -m network_control_plane.cli deploy examples/topology.yaml
python3 -m network_control_plane.cli ping h1 h2
python3 examples/example_workflow.py
# Stop the container
docker-compose down# Build the image
docker build -t network-control-plane:latest .
# Run interactively
docker run -it --rm --privileged \
-v $(pwd):/workspace \
-w /workspace \
network-control-plane:latest \
/bin/bash
# Inside the container, run:
python3 -m network_control_plane.cli deploy examples/topology.yaml# Make script executable (if needed)
chmod +x scripts/docker-run.sh
# Run the script
./scripts/docker-run.sh-
Docker Desktop installed and running
- Download from: https://www.docker.com/products/docker-desktop
- Make sure Docker Desktop is running before proceeding
-
Verify Docker is working:
docker --version docker ps
cd /path/to/NetworkControlPlane
docker build -t network-control-plane:latest .This will:
- Use Mininet's official image as base
- Install Python dependencies
- Copy your project files
- Set up the working environment
Interactive mode (recommended for first-time use):
docker run -it --rm --privileged \
-v $(pwd):/workspace \
-w /workspace \
network-control-plane:latest \
/bin/bashUsing docker-compose:
docker-compose up -d
docker-compose exec network-control-plane bashInside the container:
# Check Python and dependencies
python3 --version
python3 -c "import mininet; print('Mininet OK')"
# Test YAML parsing
python3 -c "
from network_control_plane.desired_state import DesiredStateParser
p = DesiredStateParser()
state = p.load('examples/topology.yaml')
print('✓ YAML parsing works')
"
# Deploy a topology (requires root inside container)
sudo python3 -m network_control_plane.cli deploy examples/topology.yamlsudo python3 -m network_control_plane.cli deploy examples/topology.yamlNote: Commands that create network namespaces require sudo inside the container.
# Latency and packet loss
python3 -m network_control_plane.cli ping h1 h2
# Path visibility
python3 -m network_control_plane.cli trace h1 h2
# Validate network behavior
python3 -m network_control_plane.cli validate h1 h2sudo python3 examples/example_workflow.py# In one terminal (container)
python3 -m network_control_plane.ui
# In another terminal, access from host
# The UI will be available at http://localhost:5000If you get permission errors:
# Make sure Docker Desktop is running
# Check Docker daemon status
docker infoMake sure you're using --privileged flag:
docker run -it --rm --privileged ...If running the web UI, you may need to expose ports:
docker run -it --rm --privileged \
-v $(pwd):/workspace \
-w /workspace \
-p 5000:5000 \
network-control-plane:latest \
/bin/bashRemember: Mininet operations require sudo inside the container:
sudo python3 -m network_control_plane.cli deploy examples/topology.yaml# Start container in background
docker-compose up -d
# View logs
docker-compose logs
# Execute command in running container
docker-compose exec network-control-plane bash
# Stop container
docker-compose down
# Rebuild image
docker-compose build --no-cacheFiles in your project directory are mounted as a volume, so:
- Changes to code are immediately available in the container
- Results and logs persist on your host machine
- No need to rebuild the image for code changes
- Build the Docker image
- Run the container interactively
- Test with:
sudo python3 -m network_control_plane.cli deploy examples/topology.yaml - Explore the CLI commands and web UI
For more information, see the main README.md.