azlin compose down¶
Stop and remove all services from docker-compose.azlin.yml deployment.
Synopsis¶
Description¶
Tears down all services defined in the compose file. This command:
- Stops all running containers
- Removes containers
- Optionally removes volumes
- Cleans up networks
Options¶
| Option | Description | Required |
|---|---|---|
-f, --file PATH | Path to docker-compose.azlin.yml file | Yes |
-g, --resource-group TEXT | Azure resource group | No (uses current context) |
-h, --help | Show help message | No |
Examples¶
Stop all services¶
Stop services in specific resource group¶
Output Example¶
Stopping services from docker-compose.azlin.yml...
Stopping containers...
web@web-server: Stopping... ✓
api@api-1: Stopping... ✓
api@api-2: Stopping... ✓
api@api-3: Stopping... ✓
database@db-server: Stopping... ✓
Removing containers...
web@web-server: Removed ✓
api@api-1: Removed ✓
api@api-2: Removed ✓
api@api-3: Removed ✓
database@db-server: Removed ✓
Cleanup complete!
Services stopped: 5
Containers removed: 5
VMs affected: 5
What Gets Removed¶
Removed:¶
- Running containers
- Stopped containers
- Networks created by compose
Preserved:¶
- Named volumes (unless
--volumesflag added in future) - Images
- VMs
- Volume data
Common Workflows¶
Normal teardown¶
# Stop and remove services
azlin compose down -f docker-compose.azlin.yml
# VMs remain running
azlin list
# web-server: Running
# api-1: Running
# database: Running
Complete cleanup¶
# Stop services
azlin compose down -f docker-compose.azlin.yml
# Stop VMs
azlin stop web-server api-* db-server
# Or delete VMs entirely
azlin destroy web-server --force
azlin destroy api-* --force
azlin destroy db-server --force
Update workflow¶
# Stop old version
azlin compose down -f docker-compose.azlin.yml
# Update compose file or images
vim docker-compose.azlin.yml
# Deploy new version
azlin compose up -f docker-compose.azlin.yml
Maintenance window¶
# Stop services before VM maintenance
azlin compose down -f docker-compose.azlin.yml
# Perform maintenance
azlin update web-server
azlin update api-*
azlin update db-server
# Restart services
azlin compose up -f docker-compose.azlin.yml
Troubleshooting¶
Container won't stop¶
Solution:
# Force stop on VM
azlin connect web-server
docker kill <container-id>
docker rm <container-id>
# Then retry
azlin compose down -f docker-compose.azlin.yml
Cannot connect to VM¶
Solution:
# Check VM status
azlin status api-1
# If stopped, start it
azlin start api-1
# Then retry
azlin compose down -f docker-compose.azlin.yml
Some services not found¶
This is normal if the compose file changed. azlin only stops services currently defined in the file.
Solution (clean up old containers):
# Connect to VMs and clean up manually
azlin connect vm-1
docker ps -a # List all containers
docker rm $(docker ps -aq) # Remove all stopped containers
Volume Management¶
By default, azlin compose down preserves volumes and their data.
Preserve data (default behavior)¶
Manual volume cleanup¶
# Stop services
azlin compose down -f docker-compose.azlin.yml
# Connect to VM and remove volumes
azlin connect db-server
docker volume ls
docker volume rm pgdata
Related Commands¶
- azlin compose up - Deploy services
- azlin compose ps - View service status
- azlin stop - Stop VMs
- azlin destroy - Delete VMs