Azure Container Instances
What is Azure Container Instances (ACI)?
Azure Container Instances (ACI) is a managed service that allows you to run containers directly on the Microsoft Azure public cloud, without requiring the use of virtual machines (VMs).
Azure Container Instance Features
Quick Start Azure Container Instances (ACI) using Docker Context and Docker Compose
Prerequisites
Log into Azure
$ docker login azure
This opens your web browser and prompts you to enter your Azure login credentials. If the Docker CLI cannot open a browser, it will fall back to the Azure device code flow and lets you connect manually.
Prepare a Docker Context
$ docker context create aci myaci
This command automatically uses your Azure login credentials to identify your subscription IDs and resource groups.
Use the Docker Context
$ docker context use myaci
Prepare a Docker Compose File
version: "3.9"services:dotnet-core-web-api:image: ghcr.io/kubeopsskills/dotnet-core-web-api:1.0.0deploy:restart_policy:condition: on-failureresources:reservations:cpus: '1'memory: 1Glimits:cpus: '1'memory: 1Ghealthcheck:test: ["CMD", "curl", "-f", "http://127.0.0.1:8090/health"]interval: 10stimeout: 3sretries: 3start_period: 10sports:- 8090:8090environment:ASPNETCORE_URLS: http://*:8090ASPNETCORE_ENVIRONMENT: Development
Run Docker Compose Up
$ docker compose up -d
This will create an ACI linux container group and deploy the container into it.
Loading comments...