{"id":2458,"date":"2019-09-19T01:11:10","date_gmt":"2019-09-19T01:11:10","guid":{"rendered":"http:\/\/wiki.thomasandsofia.com\/?p=2458"},"modified":"2020-04-21T10:23:01","modified_gmt":"2020-04-21T10:23:01","slug":"docker-registry","status":"publish","type":"post","link":"https:\/\/wiki.thomasandsofia.com\/?p=2458","title":{"rendered":"6: Docker Registry"},"content":{"rendered":"<p><a href=\"http:\/\/wiki.thomasandsofia.com\/?p=2448\">&lt; 5 Docker Compose<\/a> | <a href=\"\/docker-engine\/\">7 Docker Engine, Storage and Networking &gt;<\/a><\/p>\n<p>56% Complete<\/p>\n<h1>32: Docker Registry<\/h1>\n<p><a href=\"https:\/\/www.udemy.com\/learn-docker\/learn\/lecture\/15829070#content\" target=\"_blank\" rel=\"noopener\">https:\/\/www.udemy.com\/learn-docker\/learn\/lecture\/15829070#content<\/a><\/p>\n<h2>Images<\/h2>\n<p>Images are pulled from the Docker repository<\/p>\n<pre>docker pull location\/username\/imagename\r\ndocker pull imagename<\/pre>\n<p>is the same as<\/p>\n<pre>docker pull docker.io\/imagename\/imagename<\/pre>\n<p>As such:<\/p>\n<ul>\n<li>The Docker repository is assumed because none was defined.<\/li>\n<li>The username is the same as the image name.<\/li>\n<\/ul>\n<h2>Private Registry<\/h2>\n<p>Your organization may require a private registry so your images are not accessible to the public.<\/p>\n<ul>\n<li>AWS and Google both provide private registries.<\/li>\n<\/ul>\n<h3>Private Registry Login<\/h3>\n<pre>docker login private-registry.tld\r\nUsername: registry-user\r\nPassword: *******<\/pre>\n<pre>docker run private-registry.tld\/apps\/internal-app<\/pre>\n<p><span style=\"color: #ff0000;\">It is important to note that you MUST log in before pulling an image or Docker will report that the image cannot be found.<\/span><\/p>\n<h3>You can create your own local registry<\/h3>\n<pre>docker run -d -p 5000:5000 --name registry registry:2<\/pre>\n<h3>Pushing Images to your local repository<\/h3>\n<p>1. Tag the image with the URL of the registry<\/p>\n<pre>docker image tag my-image localhost:5000\/my-image<\/pre>\n<ul>\n<li>You can replace &#8216;localhost&#8217; with the URL or IP address of the Docker Registry you created.<\/li>\n<\/ul>\n<p>2. Push the image<\/p>\n<pre>docker push localhost:5000\/my-image<\/pre>\n<p>&nbsp;<\/p>\n<h1>Create Your Own Local Registry<\/h1>\n<p>No lab, self created project<\/p>\n<h2>Create the storage location on your hdd<\/h2>\n<pre>sudo mkdir -p \/var\/lib\/thomas\/docker\/registry\r\nchown thomas:thomas \/var\/lib\/thomas\/docker\/registry<\/pre>\n<h2>Create the Docker Compose file<\/h2>\n<pre>registry:\r\n  image: registry:@\r\n  ports:\r\n  - 5000:5000\r\n  volumes:\r\n  - \/var\/lib\/thomas\/docker\/registry:\/var\/lib\/registry<\/pre>\n<h2>Start It<\/h2>\n<pre>docker-compose up -d<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&lt; 5 Docker Compose | 7 Docker Engine, Storage and Networking &gt; 56% Complete 32: Docker Registry https:\/\/www.udemy.com\/learn-docker\/learn\/lecture\/15829070#content Images Images are pulled from the Docker repository docker pull location\/username\/imagename docker pull imagename is the same as docker pull docker.io\/imagename\/imagename As such: The Docker repository is assumed because none was defined. The username is the same ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/wiki.thomasandsofia.com\/?p=2458\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[52],"tags":[],"class_list":["post-2458","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2458"}],"version-history":[{"count":7,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2458\/revisions"}],"predecessor-version":[{"id":2686,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=\/wp\/v2\/posts\/2458\/revisions\/2686"}],"wp:attachment":[{"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wiki.thomasandsofia.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}