sábado, janeiro 29, 2022

Docker CLI and Azure ACI

I know, there are several good articles about how we can use docker CLI to deploy our workload to Azure ACI. I like to write short articles, it helps me understand the technology.

You can find a good documentation regarding ACI here.

I will deploy a Multi Container application using a docker compose command. Let's do it!

First, Login on Azure using

$docker login azure

Tip: You can use --tenant-id to connect to a specific Azure tenant.

Create a docker context, on my example the name is acideployblog, you need to select the subscription, resource group.

$docker context create aci acideployblog

 

You will get:

Successfully created aci context "acideployblog"

 You can list the docker context with the command

$docker context list

To set the default context

$docker context use acideployblog

To show the current context

$docker context show

Important, you must log in to your Azure Container Registry

$az acr login --name mycontainerregistry

One the directory that I have my docker compose file I run:

$docker compose --file docker-compose.staging.yml --project-name myproject-server-staging u

If you don't put a --project-name the name of your container will be derived from the working directory.

If everything goes right your container group will be create:

 

You can check the container execution list with the command

$docker ps

Um comentário:

Anônimo disse...

Good Tip! Thank you.