Easy Guide to Running Docker Containers on Azure Cloud Services (ACS).


Achieve the task with the following tools;
i. A functional Azure account.
ii. Installed Visual Studio (VS) Code in your PC with the following extensions; Azure CLI (Command Line
Interface), Docker.
First things first.
a. Create a Container in Azure.
Sign in into your Azure account and type container registries in the search bar and select.
Click on any of the highlighted button below to create a container registry.
Click on Create new to create a new Resource group if you don’t have an existing one when you click on the dropdown.
Give your Resource group are name. In this case, I gave it the name barq and click on OK. .
Give your registry a name. In this case barqreg. Since we are leaving all Networking settings in default, click on Review + create.
Click on Create again.
When Your deployment is complete page opens, click on Go to resource
From the foregoing, we have successfully created a container, barqreg in Azure. Thus, achieving the first objective. Note your login server and let’s go and achieve the next objective.
Ensure Azure CLI extension is installed. The presence of the highlighted logo below showed that we have Azure CLI extension already.
But for sake of learning, I will walk you through on how to get the extension.
Open up VS code and navigate to and click on the highlighted extension logo to install Azure CLI.
Type Azure CLI into the search bar and click on the Azure CLI Tools.
The highlight button is where you would have clicked on to install Azure CLI. It is already installed that is why it is showing uninstall.
The next step is to open the terminal by click on the 3 dots in front of Run at the top of the page, navigate to terminal and click on New Terminal as highlighted below.
You might see the prompt below. Type A for Always run and click on the Enter button to proceed.
b. Connecting Azure container to VS code in order to ease seamless communication.
Sign into Azure from the VS code terminal with the following command; az acr login --name barqreg
where barqreg
is the registry name. If successful, you should get the following output;
c. Locally building a Docker Image from the Dockerfile
in the current directory (.
)
ci. Configuring the environment.
In VS code, create a folder; in this case MEET A PHYSICIAN. Create an index.html file and paste your tailored index.html code and CRTL + S to save. The index.html codes could be generated using any of the AI platforms, Chatgpt, DeepSeek, etc.
Create another file with the title dockerfile while ensuring you have docker as an extension. Input your instructions.
cii. Building the Docker image
Run the command; docker build . -t barqreg.azurecr.io/barq_img:latest
where barqreg.azurecr.io
is the login server, bargimg
is our proposed docker image name and latest
is the tag, usually indicating the most recent version.
ciii. Pushing the Docker image into Azure.
Run the command; docker push barqreg.azurecr.io/barq_img:latest
Check your Docker account for the pushed image.
d. Creating Azure Container Instances
Definition: Azure Container Instances (ACI) is a service provided by Microsoft Azure that allows you to run containers in the cloud without managing virtual machines or orchestrators. It offers a quick and easy way to deploy containers with per-second billing and automatic resource scaling.
di. Preparing the environment; Activating the Admin User
Open your Registry in Azure. Navigate to Settings, in the dropdown, click on Access keys
Click on the box to activate the Admin user.
Type Container instances on the Azure search bar and click on it
Click on create. Give your container instance a Resource group. You can select the Resource group already created at the beginning, barq. Give the container a name. In this case barq-cont. Click on Azure Container Registry. You will notice that the Registry name and image has become what you created earlier on. Click on Review + create.
Click on create
Once the deployment has completed, click on Go to resource
Copy the IP address (Public)
Paste the address into search engine and Enter. You should now see your website.
Mission accomplished. Let me know your thoughts.
Subscribe to my newsletter
Read articles from Bala Audu Musa directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
