Install Docker on a Azure Linux VM, upload a docker image to Azure Container Registry and Deploy a Azure Container Instance Part 6 – Create an Azure container instance from a private registry

Now in our final post we’ll use our uploaded hello-azure-world image to deploy an Azure container instance.

First inside our registry we must grant admin role to the registry.

Denna bild har ett alt-attribut som är tomt. Dess filnamn är image-64.png

Next, Search for Azure container instance in the martket place and select create and use your uploaded image.

Move into the container and inside logs you’ll find that the container have launched and is displaying the hello-word container as it should.

Done and done! Good job!

Install Docker on a Azure Linux VM, upload a docker image to Azure Container Registry and Deploy a Azure Container Instance Part 5 – Push a docker image to Azure Registry

Let’s push our hello world to Azure Registry. You can check it out here.

First we must install the Azure CLI on our linux vm. Run the installer script.

curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash

Next sign in to Azure on your Linux vm.

az login

Next sign in to the azure container registry, Don’t include the ‘azurecr.io’ domain suffix.

az acr login --name 

Next tag the hello world image with your container registry name. The login server name is in the format <registry-name>.azurecr.io (all lowercase), for example, mycontainerregistry.azurecr.io.

docker tag hello-world /hello-azure-world:v1

Perfect! Now with the tag let’s push to our registry!

docker push /hello-azure-world:v1

Let’s quickly jump over to the Azure portal and check our uploaded image.

You can also check from az cli with

az acr repository list -n registryname

And finally you can now download your own hello world container from your very own Azure Container Registry!

docker run /hello-azure-world:v1

There you go! You just uploaded your very own Docker image to an Azure Container Registry and deployed it.

Now in the last post we will create an Docker instance from our hello world

Install Docker on a Azure Linux VM, upload a docker image to Azure Container Registry and Deploy a Azure Container Instance Part 4 – Create Azure Container Registry

Before we can upload our docker image we need to create an Azure Registry. So let’s do that!

Jump in to the Azure portal and search for Docker Registry in the portal and select create.

Now in the next post we’ll push our image into our very own public Azure container registry!

Install Docker on a Azure Linux VM, upload a docker image to Azure Container Registry and Deploy a Azure Container Instance Part 3 – Install Docker

Head over to Dockers site for the installation guide of Docker here.

Now let’s install docker.

sudo apt-get update
sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common

Add the GPG key to trust software by Docker.

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Since we are running ARM you’ll select the ARM architecture

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"

Now it’s time to run and install Docker on Raspberry Pi.

sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io

Finally configure docker to be able to run without sudo.

sudo groupadd docker
sudo usermod -aG docker $USER

Now log out and in again and test your Docker installation!

$ docker run hello-world

In the next post we will create an Azure Container Registry to host our new Docker image.

Install Docker on a Azure Linux VM, upload a docker image to Azure Container Registry and Deploy a Azure Container Instance Part 2 – Install a linux VM in Azure

First let’s create the VM. You can read more about it in Azure docs here.

First create a resource group to hold your VM and other resources.

az group create --name TutorialResources --location eastus

Next let’s create the Ubuntu VM.

az vm create --resource-group TutorialResources \
  --admin-username azureuser
  --name TutorialVM1 \
  --image UbuntuLTS \
  --generate-ssh-keys \
  --output json \
  --verbose

Once done try and connect using ssh and the public IP adress that displayed as part of the verbose output.

ssh azureuser@ip-adress

There we go! Now in the next post we’ll install docker.

Install Docker on a Azure Linux VM, upload a docker image to Azure Container Registry and Deploy a Azure Container Instance Part 1 – Install Azure CLI and the VSCode extension

Let’s go!

Before installing the CLI tools in VSCode make sure that you have installed the Azure CLI on your client here.

Now download and install the Azure CLI Tools so we get the Intellisense in VSCode. Search and install and restart VSCode.

Next create a file with the .azcli type so that the extension will recognize the file.

Now in the next part we will deploy the Linux VM in Azure using AZ Cli.

Run an Raspberry Pi Simulator and connect to an Azure IoT Hub Part 5 – Read IoT Messages from VSCode

Right click on your IoT device and select to monitor.

Next jump in to the simulator and run it again.

And voila! In your output you’ll find your very own simulator send information into your Azure IoT Hub.

As you can see it’s the same temperature.

Done and done! Now go out and build some IoT devices!

Run an Raspberry Pi Simulator and connect to an Azure IoT Hub Part 3 – Run the simulator

In this tutorial we will run the Raspberry Pi Simulator and connect it to our very own Azure IoT hub. Following this guide.

Go here to launch the simulator.

Next go into the Azure portal and get your Device connection key.

After you’ve launched the page go in and replace the value with your connectionstring and press run.

Voila! Your messages are being sent to your IoT hub.

In the next post we’ll set up Visual Studio Code to read the messages!