An overview of the various ways of running Docker Containers on Azure
Covers:
1) Azure Container Registry
2) Azure Container Instances
3) Azure Web App for Containers
4) Service Fabric & Service Fabric Mesh
5) Azure Kubernetes Service
on Ubuntu • Windows Server 2016 Datacenter – with containers • Docker for Azure CE (Docker Inc) • Virtual Machine Docker Extension • Marketplace • Docker EE for Azure • ARM Templates • github.com/Azure/azure-quickstart-templates
Minimise download times • Geo-replication • Control access with Azure AD • Tasks • docker build with multi-stage Dockerfiles • Automate container OS and framework patching
way to get containers running in Azure • “Serverless” containers • No need to provision VMs • Per second pricing (based on cores and memory) • Linux and Windows containers • Restart policy - Always, never, on failure • Mount Azure file shares
to support containers • Linux containers • Windows containers in preview • Provides (most) App Service features • Auto-scaling • Deployment slots • Custom domain name • App settings • Easy auth
group create -l "westeurope" -n $rg # create an app service plan to host $planName="linuxappservice" az appservice plan create -n $planName -g $rg --is-linux --sku S1 # create a new webapp based on our DockerHub image $appName="ghostatv" az webapp create -n $appName -g $rg --plan $planName -i "ghost" # configure settings az webapp config appsettings set -n $appName -g $rg --settings ` WEBSITES_PORT=2368 # launch in a browser $site = az webapp show -n $appName -g $rg --query "defaultHostName" -o tsv Start-Process https://$site
Fabric Standalone On-premises Any cloud Dev machine Dedicated Azure clusters Azure Service Fabric Azure Service Fabric Mesh Serverless microservices Full Control Fully managed
/ YAML • Services, networking configuration, persistent volumes, secrets etc • No need to pre-provision a cluster • Simply define the CPU/memory requirements of each service • …but Mesh apps can run on a regular SF cluster • Currently in preview
= "AzureThamesValleySFMesh" az group create -n $resGroup -l "westeurope" # deploy the mesh application $templateFile = ".\sfmesh-example-voting-app.json" az mesh deployment create -g $resGroup --template-file $templateFile # get public ip address $publicIp = az mesh network show -g $resGroup -n "votingNetwork" ` --query "ingressConfig.publicIpAddress" -o tsv # get status of application az mesh app show -g $resGroup -n "votingApp"
apply -f azure-vote.yaml # discover IP address kubectl get service azure-vote-front --watch # scale az aks scale -g $resourceGroup -n $clusterName --node-count 3 kubectl scale --replicas=3 deployment/azure-vote-front kubectl get pod # run kubernetes dashboard az aks browse -g $resourceGroup -n $clusterName # upgrade kubectl set image deployment azure-vote-front ` azure-vote-front=markheath/azure-vote-front:v2
Service Both are excellent orchestrators! Scheduling Upgrades Health monitoring Service discovery Windows Stateful services Serverless (Mesh) Open source tooling ecosystem Other clouds Virtual Kubelet Dev Spaces