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?
Enabling integration with VSCode
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.
Deploying to ACI
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
Now we can open and select one of the images, right click, and select “Deploy Image to Azure Container Instances”:
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.
About the Author:
Developer since 2011, working with high availability web and cloud native applications since 2013 and homebrewer in the free time. Microsoft MVP Reconnect and Google GDE. Loves communities <3
Santos, L. (2020). Docker image deploy: from VSCode to Azure in a click. Available at: https://dev.to/azure/docker-image-deploy-from-vscode-to-azure-in-a-click-5193 [Accessed: 12th November 2020].