Bobcares

Run Docker container on Azure ACI Like A Pro

PDF Header PDF Footer

Learn how to run Docker containers on Azure ACI like a professional. Our Docker Support team is here to answer queries and concerns.

Run Docker container on Azure ACI Like A Pro

Run Docker container on Azure ACI Like A ProACI, short for Azure Container Instances, offers a fast and flexible way to run containers in the cloud without the overhead of managing virtual machines or orchestrators like Kubernetes.

It lets us focus on building and deploying your applications, while Azure takes care of provisioning and scaling the infrastructure behind the scenes.

Today, we will explore the Azure Container Instances, how to deploy them using both the Azure Portal and CLI, and how to manage and clean up our resources.

 

What are Azure Container Instances?

Azure Container Instances is a serverless container service on Microsoft Azure. It allows developers to deploy containerized applications quickly without managing VMs or container orchestrators. We can use standard Docker images from registries like Docker Hub or Azure Container Registry, and run containers directly from the Azure portal or CLI.

Here are some of the key benefits offered by ACI:

  • No infrastructure management.
  • Deploy containers in seconds.
  • Supports Windows and Linux.
  • Only pay for the resources we use.

Need to lock down access to your containers? Learn how to whitelist IPs in the Azure portal for an added layer of security.

How to Deploy a Container Instance via Azure Portal

  1. Start by logging into the Azure Portal https://portal.azure.com.
  2. Then, click Create a resource > Containers > Container Instances.
  3. On the Basics page, fill in the required details:
    • Subscription
    • Resource group: Create new > myresourcegroup
    • Container name: mycontainer
    • Image source: Quickstart images
    • Container image: `mcr.microsoft.com/azuredocs/aci-helloworld:latest`
    • OS type: Linux (or Windows)
    • CPU/Memory size: Choose based on workload
  4. Now, click Next to go to Networking.
  5. Then, choose Public for DNS accessibility.
  6. Enter a unique DNS name label (e.g., `aci-demo`) and set DNS name label scope to Tenant for better security.

    This configuration creates a public endpoint for our container:

    http://<dns-name-label>.<region>.azurecontainer.io

    Planning to integrate ACI with other Azure services? Azure Data Factory’s flatten hierarchy feature can help streamline data workflows within your containers.

  7. Next, click Review + Create, then Create. Wait for the deployment to complete.
  8. Once deployed, go to Resource Groups > myresourcegroup > mycontainer and click on the FQDN link to access the application in the browser.

View Container Logs via Azure Portal

We need to monitor logs and diagnose application issues. To view logs:

  1. First, go to the container instance.
  2. Then, go to Settings > Containers > Logs.
  3. Now, we will see HTTP GET request logs from browser interactions.

Encountering strange errors like  read ECONNRESET while integrating with Azure DevOps? This troubleshooting guide could help clarify the root cause.

Clean Up Resources via Portal

To avoid incurring unnecessary costs:

    1. Go to the Overview tab of the container instance.
    2. Then, click Delete, then confirm.

How to Deploy a Container Using Azure CLI

The prerequisites include Azure Cloud Shell (Bash) or we need to install Azure CLI locally.

  1. First, we need to create a Resource Group:

    az group create --name myResourceGroup --location eastus
  2. Then, create the Container Instance


    az container create \
    --resource-group myResourceGroup \
    --name mycontainer \
    --image mcr.microsoft.com/azuredocs/aci-helloworld \
    --dns-name-label aci-demo \
    --ports 80
  3. To display Container info:


    az container show \
    --resource-group myResourceGroup \
    --name mycontainer \
    --query "{FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}" \
    --out table
  4. To view logs:

    az container logs --resource-group myResourceGroup --name mycontainer
  5. Now, attach the Output stream:

    az container attach --resource-group myResourceGroup --name mycontainer
  6. To clean up resources:

    az container delete --resource-group myResourceGroup --name mycontainer

We can list all containers in a group with this command:

az container list --resource-group myResourceGroup --output table

[Need assistance with a different issue? Our team is available 24/7.]

Conclusion

Azure Container Instances make it easy to deploy and manage containers in the cloud with minimal overhead. It is an excellent solution for quick, scalable container deployments.

In brief, our Support Experts demonstrated how to run Docker containers on Azure ACI.

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Docker Support

Spend time on your business, not on your servers.

Managing a server is time consuming. Whether you are an expert or a newbie, that is time you could use to focus on your product or service. Leave your server management to us, and use that time to focus on the growth and success of your business.

TALK TO US Or click here to learn more.

Speed issues driving customers away?
We’ve got your back!

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

_reb2bgeo - The visitor's geographical location

_reb2bloaded - Whether or not the script loaded for the visitor

_reb2bref - The referring URL for the visit

_reb2bsessionID - The visitor's RB2B session ID

_reb2buid - The visitor's RB2B user ID

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid
_reb2bgeo, _reb2bloaded, _reb2bref, _reb2bsessionID, _reb2buid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF