{
    "id": "f452f394-941f-42b0-ab1e-ebe60aea4001",
    "name": "Provision and Use an Azure Container Registry",
    "slug": "provision-and-use-an-azure-container-registry",
    "status": "published",
    "lab_type": "pta",
    "is_sample": false,
    "duration_in_seconds": 1800,
    "metadata": {
        "courses": [
            "dc286467-7a98-4ddc-bba5-e8defebf3420",
            "1684bedc-e75a-42a8-8912-6d5cd3cff45c",
            "d912fd3f-d9a9-4107-a303-71f8d2b1f2e5"
        ],
        "pta_sdn": "415",
        "pta_namespace": "my.ine",
        "learning_paths": [],
        "has_published_parent": true
    },
    "session": null,
    "company": "a491bc32-c056-4946-9169-cc053387bada",
    "created": "2022-10-07T17:45:07.490709Z",
    "modified": "2023-10-03T18:58:25.142904Z",
    "is_beta": false,
    "lab_objectives": [],
    "main_learning_area": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
    "learning_areas": [
        {
            "id": "d3f82c70-f4e7-428e-afd7-4b1d28988e18",
            "name": "Cloud",
            "slug": "cloud"
        }
    ],
    "categories": [],
    "tags": [],
    "difficulty": null,
    "is_web_access": true,
    "is_lab_experience": false,
    "is_featured": false,
    "cve": null,
    "severity": null,
    "year": null,
    "classification": null,
    "is_trackable": false,
    "cpe_credits": null,
    "is_skill_check": false,
    "external_url": "",
    "solution_video": null,
    "explanation_video": null,
    "description": "Provision an Azure container registry and push an image to the registry.",
    "description_html": "<p>Provision an Azure container registry and push an image to the registry.</p>",
    "tasks": "",
    "tasks_html": "",
    "published_date": "2020-06-16T15:32:04Z",
    "solutions": "# Provision an Azure container registry\n\nWhen 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.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/1.png)\n\nSearch for *container registry* and open the **Container registries** service as highlighted below.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/2.png)\n\nClick on **Create** to start creating the container registry.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/3.png)\n\nConfigure the container registry as below:\n\n* Use the assigned resource group\n\n* Give a unique name to the container registry\n\n* Use **Standard** SKU\n\nNow click on **Review + Create**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/4.png)\n\nAzure will verify the configuration and it will show **Validation passed**. Click on **Create** to provision the container registry.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/5.png)\n\nYou will see *Your deployment is complete* which means container registry is provisioned. You can click on **Go to resource** to check the resource.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/6.png)\n\nIn your container registry go to **Access keys** and enable the **Admin user**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/7.png)\n\nAfter the admin user is enabled note down the username and password for your contianer registry. We will use them later.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/8.png)\n\n# Push a custom image to the registry\n\nGo to your assigned resource group and go to **Deployments**. Open the **Design-Infra** one which was used to deploy the pre requisites. \n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/9.png)\n\nHere go to outputs and note down the password. This password is for the virtual machine.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/10.png)\n\nNow go to your virtual machine and note down the public IP address for your virtual machine.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/11.png)\n\nConnect to the virtual machine through **SSH**. Use the below command in any of the terminals.\n\n```\nssh student@PublicIP_of_VM\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/12.png)\n\nPull a custom Docker image from Docker Hub with the below command\n\n```\nsudo docker pull twallace27603/pythonserver:latest\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/13.png)\n\nNow tag the image with your registry using the below command\n\n```\nsudo docker tag twallace27603/pythonserver:latest <your login server>/taskimage:1.0\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/14.png)\n\nAfter tagging log in to your container registry\n\n```\nsudo docker login -u <your Username> <your login server>\n```\n\nUse the username, password and login server you noted down from access keys of your container registry.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/15.png)\n\nAt last push this image to your container registry with the following command\n\n```\nsudo docker push <your login server>/taskimage:1.0>\n```\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/16.png)\n\nGo 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.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/17.png)\n\nSelect the tag **1.0**.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/18.png)\n\nYou can now review the mainfest for tag 1.0 of our image.\n\n![](https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/19.png)\n\nOur lab is now complete.",
    "solutions_html": "<h1>Provision an Azure container registry</h1>\n<p>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.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/1.png\" /></p>\n<p>Search for <em>container registry</em> and open the <strong>Container registries</strong> service as highlighted below.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/2.png\" /></p>\n<p>Click on <strong>Create</strong> to start creating the container registry.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/3.png\" /></p>\n<p>Configure the container registry as below:</p>\n<ul>\n<li>\n<p>Use the assigned resource group</p>\n</li>\n<li>\n<p>Give a unique name to the container registry</p>\n</li>\n<li>\n<p>Use <strong>Standard</strong> SKU</p>\n</li>\n</ul>\n<p>Now click on <strong>Review + Create</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/4.png\" /></p>\n<p>Azure will verify the configuration and it will show <strong>Validation passed</strong>. Click on <strong>Create</strong> to provision the container registry.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/5.png\" /></p>\n<p>You will see <em>Your deployment is complete</em> which means container registry is provisioned. You can click on <strong>Go to resource</strong> to check the resource.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/6.png\" /></p>\n<p>In your container registry go to <strong>Access keys</strong> and enable the <strong>Admin user</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/7.png\" /></p>\n<p>After the admin user is enabled note down the username and password for your contianer registry. We will use them later.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/8.png\" /></p>\n<h1>Push a custom image to the registry</h1>\n<p>Go to your assigned resource group and go to <strong>Deployments</strong>. Open the <strong>Design-Infra</strong> one which was used to deploy the pre requisites. </p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/9.png\" /></p>\n<p>Here go to outputs and note down the password. This password is for the virtual machine.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/10.png\" /></p>\n<p>Now go to your virtual machine and note down the public IP address for your virtual machine.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/11.png\" /></p>\n<p>Connect to the virtual machine through <strong>SSH</strong>. Use the below command in any of the terminals.</p>\n<pre class=\"codehilite\"><code>ssh student@PublicIP_of_VM</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/12.png\" /></p>\n<p>Pull a custom Docker image from Docker Hub with the below command</p>\n<pre class=\"codehilite\"><code>sudo docker pull twallace27603/pythonserver:latest</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/13.png\" /></p>\n<p>Now tag the image with your registry using the below command</p>\n<pre class=\"codehilite\"><code>sudo docker tag twallace27603/pythonserver:latest &lt;your login server&gt;/taskimage:1.0</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/14.png\" /></p>\n<p>After tagging log in to your container registry</p>\n<pre class=\"codehilite\"><code>sudo docker login -u &lt;your Username&gt; &lt;your login server&gt;</code></pre>\n\n<p>Use the username, password and login server you noted down from access keys of your container registry.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/15.png\" /></p>\n<p>At last push this image to your container registry with the following command</p>\n<pre class=\"codehilite\"><code>sudo docker push &lt;your login server&gt;/taskimage:1.0&gt;</code></pre>\n\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/16.png\" /></p>\n<p>Go to the container registry in your azure portal and open the <strong>Repositories</strong>. You will see that an image named <strong>taskimage</strong> is there. Click on it.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/17.png\" /></p>\n<p>Select the tag <strong>1.0</strong>.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/18.png\" /></p>\n<p>You can now review the mainfest for tag 1.0 of our image.</p>\n<p><img alt=\"\" src=\"https://assets.ine.com/content/labs/azure-course-labs/provision-and-use-an-azure-container-registry/19.png\" /></p>\n<p>Our lab is now complete.</p>",
    "flags": [],
    "min_points_to_pass": null,
    "access_type": "web",
    "user_status": "unstarted",
    "user_lab_status": null,
    "user_status_modified": null,
    "user_flags": [],
    "global_running_session": null
}