Azure Container Instances
There are (at least) 3 diffent ways how to run a Docker Container on Azure:
- Using the Web App for Containers
- Using Azure Kubernetes Service (AKS)
- Using Azure Container Instances
In this blogpost we will take a small look how to run a Docker Container on this service. The “Azure Container Instances”-service is a pretty easy service and might be a good first start. I will do this step for step guide via the Azure Portal. You can use the CLI or Powershell. My guide is more or less the same as this one, but I will highlight some important points in my blogpost, so feel free to check out the official docs.
Using Azure Container Instances
1. Add new…
At first search for “Container Instances” and this should show up:
2. Set base settings
Now - this is propably the most important step - choose the container name and source of the image. Those settings can’t be changed later on!
The image can be from a Public Docker Hub repository or from a prive docker registry.
Important: If you are using a Private Docker Hub repository use ‘index.docker.io’ as the login server. It took me a while to figure that out.
3. Set container settings
Now you need to choose which OS and how powerful the machine should be.
Important: If you want an easy access via HTTP to your container, make sure to set a “DNS label”. With this label you access it like this: customlabel.azureregion.azurecontainer.io
Make sure to set any needed environment variables here.
Also keep in mind: You can’t change this stuff later on.
In the last step you will see a summery of the given settings:
After you finish the setup your Docker Container should start after a short amount of time (depending on your OS and image of course).
The most important aspect here:
Check the status, which should be “running”. You can also see your applied FQDN.
This service is pretty easy. The setup itself is not hard, but sometimes the UI seems “buggy”, but if you can run your Docker Container locally, you should also be able to run it on this service.
Hope this helps!