{"id":75913,"date":"2020-09-25T18:00:43","date_gmt":"2020-09-25T15:00:43","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-package-and-transfer-docker-images-from-one-server-to-another-cloudsavvy-it\/"},"modified":"2020-09-25T18:00:43","modified_gmt":"2020-09-25T15:00:43","slug":"how-to-package-and-transfer-docker-images-from-one-server-to-another-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-package-and-transfer-docker-images-from-one-server-to-another-cloudsavvy-it\/","title":{"rendered":"#How To Package and Transfer Docker Images From One Server to Another \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2738e59c795\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2738e59c795\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-package-and-transfer-docker-images-from-one-server-to-another-cloudsavvy-it\/#You_Dont_Need_A_Container_Registry\" >You Don\u2019t Need A Container Registry<\/a><\/li><\/ul><\/nav><\/div>\n<p><strong>&#8220;#How To Package and Transfer Docker Images From One Server to Another \u2013 CloudSavvy IT&#8221;<\/strong><\/p>\n<div id=\"article-content-area\">\n<img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-503\" src=\"https:\/\/www.cloudsavvyit.com\/thumbcache\/0\/0\/576bdb68675c300a17d82c131b23c927\/p\/uploads\/2019\/06\/c454d054.png\" alt=\"\" width=\"700\" height=\"300\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you\u2019ve built a Docker image on your development machine, and want to deploy it on a server, you could use a Docker registry, but Docker also has tools for saving images to files, and loading them on a different server.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"You_Dont_Need_A_Container_Registry\"><\/span>You Don\u2019t Need A Container Registry<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Usually, to transfer a build of a container (called an image) to a remote server, you use a Docker container registry. This is by far the best method\u2014it\u2019s a single point of authority, making it easy to distribute updates across multiple servers. This doesn\u2019t require you to make the container public either; there are plenty of great private container registries, such as Google\u2019s <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/cloud.google.com\/container-registry\">GCR<\/a> and AWS\u2019s <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/aws.amazon.com\/ecr\/?tag=reviewgeek-20\">ECS<\/a>. The Docker Hub even support private repositories. If you\u2019re simply concerned about privacy, switch to a private registry and continue using <code>docker push<\/code>\u00a0and <code>docker pull<\/code>.<\/p>\n<p>However, for those looking to do it the old fashioned way, the Docker CLI contains some tools for saving images to files, and loading them on a remote server.<\/p>\n<p>To save an image, you can use <a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/save\/\"><code>docker save<\/code><\/a>, specifying an output file, and then specify an image name and tag:<\/p>\n<pre>docker save -o .\/savedimage imagename:tag<\/pre>\n<p>If you don\u2019t specify a tag, Docker will package all tags.<\/p>\n<p>This will serialize and save a copy of the image under the output file. The image is stored as a tarfile. If you\u2019d like to save it as a <code>tar.gz<\/code>, you can omit the <code>-o<\/code>\u00a0flag and pipe the output to <code>gzip<\/code>:<\/p>\n<pre>docker save imagename:tag | gzip &gt; savedimage.tar.gz<\/pre>\n<p>You can then take this file and <code>scp<\/code>\u00a0or FTP copy to the target server. Once it\u2019s there, you can use <code><a rel=\"nofollow noopener noreferrer\" target=\"_blank\" href=\"https:\/\/docs.docker.com\/engine\/reference\/commandline\/load\/\">docker load<\/a><\/code>\u00a0to import it again:<\/p>\n<pre>docker load -i savedimage<\/pre>\n<p>This will make the image available on the target system as if you had ran <code>docker build . -t imagename<\/code>. You can use it just like a locally build image with <code>docker container run<\/code>:<\/p>\n<pre>docker container run imagename<\/pre>\n<\/div>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener noreferrer\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/6969\/how-to-package-and-transfer-docker-images-from-one-server-to-another\/\" target=\"_blank\" rel=\"noopener noreferrer\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;#How To Package and Transfer Docker Images From One Server to Another \u2013 CloudSavvy IT&#8221; If you\u2019ve built a Docker image on your development machine, and want to deploy it on a server, you could use a Docker registry, but Docker also has tools for saving images to files, and loading them on a different&#8230;<\/p>\n","protected":false},"author":1,"featured_media":75914,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2019\/06\/c454d054.png","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-75913","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/75913","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=75913"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/75913\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/75914"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=75913"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=75913"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=75913"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}