We commented in this post on my blog (PT) that Docker would be gaining native integration with Azure! With this integration, deploying a docker image directly to Azure Container Instances (ACI) would be as easy as a single command in the Docker CLI.
The integration was already present in Docker Edge, which is the beta version of Docker. Now we have the excellent news that this integration has arrived for all Docker users! And, together with her, now we have the same direct integration in VSCode!
And how can we use it?
First, we need to have Docker installed on the machine. If you don't already have it then go to the official website and download the
stable version for your operating system.
Once you download and install Docker, log in to Azure using the following command:
azure docker login
And then create a new context using the command
docker context create aci <name>, the context name is up to you!
Notice that, at the end of the sidebar, we will have a menu called Contexts. Open it and right click on the context you just created. Select Use:
With the context selected, we already have everything we need to do our deploy.
With the extension, we can login to our DockerHub or Azure Container Registry:
From there we can select the type of record we are using
And then we will have the list of our images hosted on these services:
Now we can open and select one of the images, right click, and select "Deploy Image to Azure Container Instances":
See the process as a whole:
From there you will have prompts to enter the name of your ACI or if you want to use an existing one, and you can also bring the logs, open ports and more!
The native integration of Docker with ACI is one of the most interesting tools we have when we are referring to the cloud. This direct integration capability makes it much easier to carry out our deploys and also manage our containers.