无法找到Docker for Azure CE,寻求本地Ubuntu Docker Swarm部署Azure替代方法
Hey there, sorry to hear you're hitting a roadblock with Docker for Azure CE missing from the Azure Marketplace — it’s frustrating when the official tutorial doesn’t line up with what you’re seeing. The likely culprit here is that Docker deprecated Docker for Azure CE, so it’s no longer listed in the Marketplace. But don’t worry, there are solid alternatives to get your local Docker Swarm deployed to Azure. Let’s break them down:
Alternative 1: Spin up a manual Swarm cluster with Azure VMs
This approach gives you full control over the swarm nodes, just like Docker for Azure CE used to:
- Provision Ubuntu VMs: Use the Azure CLI to create a manager node and as many worker nodes as you need. For the manager:
Repeat the command for workers, changing theaz vm create --resource-group my-swarm-rg --name swarm-manager --image UbuntuLTS --admin-username azureuser --generate-ssh-keys --public-ip-sku Standard--nameparameter each time. - Install Docker on each VM: SSH into every VM and run the official Docker install script:
Log out and back in to apply the group change.curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh sudo usermod -aG docker azureuser - Initialize the swarm: On the manager node, run:
Copy thedocker swarm init --advertise-addr <manager-public-ip>docker swarm joincommand it outputs, then run that on all worker nodes to add them to the swarm. - Connect your local Docker to the Azure swarm: To deploy services from your local machine to the Azure swarm, point your Docker client to the manager’s daemon. First, ensure port 2376 is open in the manager’s NSG (for TLS) or use port 2375 (not recommended for production), then set:
Now you can useexport DOCKER_HOST=tcp://<manager-public-ip>:2376docker stack deployand other swarm commands just like you would locally.
Alternative 2: Use Azure Container Instances (ACI) with Swarm integration
If you don’t want to manage VMs, Docker Swarm can integrate directly with ACI to run services as managed containers:
- Log Docker into Azure: From your local machine, run:
docker login azure - Create an ACI context: This links your Docker client to your Azure subscription:
docker context create aci my-aci-swarm - Deploy your stack to ACI: Use your existing
docker-compose.ymlto deploy the stack directly to ACI:
ACI handles all the infrastructure management, so you don’t have to worry about patching VMs or scaling nodes manually.docker --context my-aci-swarm stack deploy -c docker-compose.yml my-app-stack
Alternative 3: Migrate to Azure Kubernetes Service (AKS) (if flexible on orchestrator)
If you’re open to shifting to Kubernetes (which is widely supported in Azure), you can deploy your Swarm-style workloads to AKS:
- Create an AKS cluster: Use the Azure CLI to provision a cluster:
az aks create --resource-group my-aks-rg --name my-aks-cluster --node-count 2 --enable-addons monitoring --generate-ssh-keys - Link Docker to AKS: Configure your Docker client to use the AKS context:
az aks get-credentials --resource-group my-aks-rg --name my-aks-cluster docker context use kubernetes - Deploy your stack: Most Swarm
docker-compose.ymlfiles work with Kubernetes via Docker’s integration:
Note: Some Swarm-specific features (like secrets or configs) map to Kubernetes equivalents, so you might need minor tweaks to your compose file.docker stack deploy -c docker-compose.yml my-aks-stack
Hopefully one of these paths gets you back on track to deploying your swarm workloads to Azure!
内容的提问来源于stack exchange,提问作者tryingHard

