There are multiple ways to create an Azure Container Instance as stated below.
In this demo, I will be using the Azure CLI because it is cross-platform and can be used across any platform. Also in the Azure CLI, the command syntax is very simple.
We are going to deploy a website running the open-source Ghost blogging platform.
Step 1
Login to your Azure account and switch to your preferred subscription.
Step 2
Save the resource group name and location name in their respective variables.
Step 3
Create a resource group by running the following command.
Step 4
Next, store the container group’s name in a variable.
Step 5
This command creates the container group. We have specified the resource group name, the container group name, the official Ghost image of the Ghost blogging platform which we are going to pull down from the Docker hub. The default port is 2368 by Ghost and we have specified that the IP address should be public and with that, we have given it a DNS label name.
Step 6
It will take some time for the container to be up and running so initially, it will show Pending in the provisioning state.
Step 7
To check the status, you can run the following command.
Step 8
You will be able to see after some time that it shows the provisioning state as succeeded. It would give a public IP address and a fully qualified domain name as well.
Step 9
If you access the domain name at port 2368, you will see something like this.
Step 10
So, you can say that this is a very fast way to get up and running with a bit of open-source software.
Supposing that we wanted it to run permanently, we would have found a cheaper way of hosting it, maybe by hosting the container on Azure App Service.
This is just an easy way to see how things are actually done.
Step 11
Next, let us see how we can access the logs of our container. You can simply run this command to see the container logs.