Provision an Azure container registry and push an image to the registry.

Provision an Azure container registry

When you will login to the azure with the provided credentials, you will find some predeployed resources. This is all you will need for this lab.

Search for container registry and open the Container registries service as highlighted below.

Click on Create to start creating the container registry.

Configure the container registry as below:

Now click on Review + Create.

Azure will verify the configuration and it will show Validation passed. Click on Create to provision the container registry.

You will see Your deployment is complete which means container registry is provisioned. You can click on Go to resource to check the resource.

In your container registry go to Access keys and enable the Admin user.

After the admin user is enabled note down the username and password for your contianer registry. We will use them later.

Push a custom image to the registry

Go to your assigned resource group and go to Deployments. Open the Design-Infra one which was used to deploy the pre requisites.

Here go to outputs and note down the password. This password is for the virtual machine.

Now go to your virtual machine and note down the public IP address for your virtual machine.

Connect to the virtual machine through SSH. Use the below command in any of the terminals.

ssh student@PublicIP_of_VM

Pull a custom Docker image from Docker Hub with the below command

sudo docker pull twallace27603/pythonserver:latest

Now tag the image with your registry using the below command

sudo docker tag twallace27603/pythonserver:latest <your login server>/taskimage:1.0

After tagging log in to your container registry

sudo docker login -u <your Username> <your login server>

Use the username, password and login server you noted down from access keys of your container registry.

At last push this image to your container registry with the following command

sudo docker push <your login server>/taskimage:1.0>

Go to the container registry in your azure portal and open the Repositories. You will see that an image named taskimage is there. Click on it.

Select the tag 1.0.

You can now review the mainfest for tag 1.0 of our image.

Our lab is now complete.