{"id":15678,"date":"2020-08-07T07:59:02","date_gmt":"2020-08-07T07:59:02","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=15678"},"modified":"2020-08-07T07:59:03","modified_gmt":"2020-08-07T07:59:03","slug":"push-your-first-image-to-a-private-docker-container-registry","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/","title":{"rendered":"Push your first image to a private Docker container registry"},"content":{"rendered":"\n<p>This tutorial will help you to Push your first image to a private Docker container registry. An Azure container registry stores and manages private\u00a0Docker\u00a0container images, similar to the way\u00a0Docker Hub\u00a0stores public Docker images. You can use the\u00a0Docker command-line interface\u00a0(Docker CLI) for\u00a0login,\u00a0push,\u00a0pull, and other operations on your container registry.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"log-in-to-a-registry\"><strong>Log in to a registry<\/strong><\/h3>\n\n\n\n<p>There are\u00a0several ways to authenticate\u00a0to your private container registry. The recommended method when working in a command line is with the Azure CLI command\u00a0az acr login. For example, to log in to a registry named\u00a0<em>myregistry<\/em>:<\/p>\n\n\n\n<p>az acr login &#8211;name myregistry<\/p>\n\n\n\n<p>You can also log in with\u00a0docker login. For example, you might have\u00a0assigned a service principal\u00a0to your registry for an automation scenario. When you run the following command, interactively provide the service principal appID (username) and password when prompted.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pull-the-official-nginx-image\"><strong>Pull the official Nginx image<\/strong><\/h3>\n\n\n\n<p>First, pull the public Nginx image to your local computer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-the-container-locally\"><strong>Run the container locally<\/strong><\/h3>\n\n\n\n<p>Execute following\u00a0docker run\u00a0command to start a local instance of the Nginx container interactively (<code>-it<\/code>) on port 8080. The\u00a0<code>--rm<\/code>\u00a0argument specifies that the container should be removed when you stop it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-an-alias-of-the-image\"><strong>Create an alias of the image<\/strong><\/h3>\n\n\n\n<p>Use\u00a0docker tag\u00a0to create an alias of the image with the fully qualified path to your registry. This example specifies the\u00a0<code>samples<\/code>\u00a0namespace to avoid clutter in the root of the registry.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"push-the-image-to-your-registry\"><strong>Push the image to your registry<\/strong><\/h3>\n\n\n\n<p>Now that you&#8217;ve tagged the image with the fully qualified path to your private registry, you can push it to the registry with\u00a0docker push<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"pull-the-image-from-your-registry\"><strong>Pull the image from your registry<\/strong><\/h3>\n\n\n\n<p>Use the\u00a0docker pull\u00a0command to pull the image from your registry<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"start-the-nginx-container\"><strong>Start the Nginx container<\/strong><\/h3>\n\n\n\n<p>Use the\u00a0docker run\u00a0command to run the image you&#8217;ve pulled from your registry<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"remove-the-image-optional\"><strong>Remove the image (optional)<\/strong><\/h3>\n\n\n\n<p>If you no longer need the Nginx image, you can delete it locally with the\u00a0docker rmi\u00a0command.<\/p>\n\n\n\n<p>To remove images from your Azure container registry, you can use the Azure CLI command\u00a0az acr repository delete. For example, the following command deletes the manifest referenced by the\u00a0<code>samples\/nginx:latest<\/code>\u00a0tag, any unique layer data, and all other tags referencing the manifest.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.testpreptraining.ai\/microsoft-azure-architect-technologies-az-303-free-practice-test\" target=\"_blank\" rel=\"noopener noreferrer\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"150\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png\" alt=\"free practice test for AZ- 303\" class=\"wp-image-13928\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png 960w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5-750x117.png 750w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/a><\/figure><\/div>\n\n\n\n<p><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/exam-az-303-microsoft-azure-architect-technologies\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Go back to home page <\/strong><\/a><\/p>\n\n\n\n<p class=\"has-text-align-right\"><strong>Reference documentation &#8211; <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/container-registry\/container-registry-get-started-docker-cli\" target=\"_blank\" rel=\"noreferrer noopener\">Push your first image to a private Docker container registry using the Docker CLI<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will help you to Push your first image to a private Docker container registry. An Azure container registry stores and manages private\u00a0Docker\u00a0container images, similar to the way\u00a0Docker Hub\u00a0stores public Docker images. You can use the\u00a0Docker command-line interface\u00a0(Docker CLI) for\u00a0login,\u00a0push,\u00a0pull, and other operations on your container registry. Log in to a registry There are\u00a0several&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-15678","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Push your first image to a private Docker container registry<\/title>\n<meta name=\"description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Push your first image to a private Docker container registry.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Push your first image to a private Docker container registry\" \/>\n<meta property=\"og:description\" content=\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Push your first image to a private Docker container registry.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2020-08-07T07:59:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/\",\"name\":\"Push your first image to a private Docker container registry\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2020-08-07T07:59:02+00:00\",\"dateModified\":\"2020-08-07T07:59:03+00:00\",\"description\":\"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Push your first image to a private Docker container registry.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Push your first image to a private Docker container registry\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Push your first image to a private Docker container registry","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Push your first image to a private Docker container registry.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/","og_locale":"en_US","og_type":"article","og_title":"Push your first image to a private Docker container registry","og_description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Push your first image to a private Docker container registry.","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2020-08-07T07:59:03+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2020\/07\/Untitled-design-5.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/","name":"Push your first image to a private Docker container registry","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2020-08-07T07:59:02+00:00","dateModified":"2020-08-07T07:59:03+00:00","description":"Enhance and upgrade your Azure Architect skills by preparing from tutorial - Push your first image to a private Docker container registry.","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/push-your-first-image-to-a-private-docker-container-registry\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Push your first image to a private Docker container registry"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15678","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=15678"}],"version-history":[{"count":1,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15678\/revisions"}],"predecessor-version":[{"id":15684,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/15678\/revisions\/15684"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=15678"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=15678"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=15678"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}