A containerized Azure provisioning agent that simulates Azure Instance Metadata Service (IMDS) and WireServer for testing and development environments.
Warning
Running the ./start-all.sh script will modify your local machine due to how systemd in Docker works! Whenever possible, do not run this system on your personal machine as it completes the full provisioning run found in azure-init. This may affect your local hostname, ssh keys, users, or more. Exercise caution running this system locally!
This project consists of two main components:
- Provisioning Agent: A systemd-based service running
azure-initbinary in a container - Testing Server: A mock Azure service providing IMDS and WireServer endpoints
The setup creates two Docker networks with Azure-like IP addresses:
imds-network(169.254.0.0/16) - For IMDS communicationwireserver-network(168.63.0.0/16) - For WireServer communication
- Docker and Docker Compose
- WSL2 or Linux environment
- The
azure-initbinary and service file
Run the start script to launch both services:
./start-all.shThis will:
- Start the testing server container first (creates networks with Azure IP addresses)
- Wait for the testing server to be ready
- Start the provisioning agent
The start-all.sh script also accepts an optional base image parameter for the Azure-init container.
./start-all.sh debian:12Without a base container image argument, start-all defaults to Ubuntu 24.04.
The list of currently tested images can be found in the e2e testing workflow.
Stop all services and clean up:
./stop-all.shThis will:
- Stop the provisioning agent container
- Stop the testing server container
- Remove orphaned containers
- Clean up Docker networks
- Container:
azureinit-provisioning-agent - Image: Built from local Dockerfile
- Service: systemd-based
azure-init.service - Privileges: Runs with
privileged: truefor systemd support - Binary Location: In the container, located at
/usr/local/bin/azure-init
- Container:
azure-testing-server - Endpoints:
- IMDS:
http://169.254.169.254/metadata/instance - WireServer:
http://168.63.129.16
- IMDS:
- Port: 80 (mapped to host)
Provisioning Agent:
docker compose logs -f provisioning-agentTesting Server:
cd testing-server
docker compose logs -f testing-serverThe Dockerfile expects:
azure-init/target/debug/azure-init- The main binary (compiled viacargo build)azure-init/config/azure-init.service- The systemd service file