{"id":6339,"date":"2021-04-26T16:04:40","date_gmt":"2021-04-26T10:34:40","guid":{"rendered":"https:\/\/www.skynats.com\/?p=6339"},"modified":"2024-11-05T17:34:44","modified_gmt":"2024-11-05T12:04:44","slug":"unable-to-download-docker-images","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/unable-to-download-docker-images\/","title":{"rendered":"Unable to download Docker images behind a proxy"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Let&#8217;s have a glance at troubleshooting dockers issues like Unable to download Docker images behind a proxy<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As a part of\u00a0our <a href=\"https:\/\/www.skynats.com\/linux-server-management\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#026e9c\" class=\"has-inline-color\">server management services<\/span><\/a>, we use to handle several such Docker-related issues. You can also consult our technical team support for further assistance. Here in this blog we will see how to resolve this issue<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&nbsp;Fixing the error.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of our client reports where he tries to run the below command to install <a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noopener\">Docker<\/a> on the ubuntu server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo docker pull busybox<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The following error was displayed on the screen<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Pulling repository busybox\n2021\/03\/16 09:37:07 Get https:\/\/index.docker.io\/v1\/repositories\/busybox\/images: dial tcp: lookup index.docker.io on 127.0.1.1:53: no answer from server<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>How to resolve the error<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In order to resolve this problem, we first create a systemd drop-in directory for the Docker service and then execute the command.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/etc\/systemd\/system\/docker.service.d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Later, create a file called \/etc\/systemd\/system\/docker.service.d\/http-proxy.conf that adds the HTTP_PROXY environment variable:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">[Service]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Environment=&#8221;HTTP_PROXY=http:\/\/proxy.example.com:80\/&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Note: In case, if you have internal Docker registries then contact without proxying you can specify them via the NO_PROXY environment variable:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Environment<em>=&#8221;HTTP_PROXY=<\/em>http:\/\/proxy.example.com:80\/&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Environment=&#8221;NO_PROXY=localhost,127.0.0.0\/8,docker-registry.somecorporation.com&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Executive the commands to flush the changes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl daemon-reload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the command to verify whether the configuration is loaded or not.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl show --property Environment docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Environment=HTTP_PROXY=http:\/\/proxy.example.com:80\/<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command in order to restart the docker<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl restart docker<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will fix the error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Conclusion<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In short, follow the methods to resolve the issue &#8220;Unable to download Docker images behind a proxy&#8221;. Need further assistance to fix any sort of error, get in touch with us with <a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#0572a1\" class=\"has-inline-color\">24\/7 technical support<\/span><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s have a glance at troubleshooting dockers issues like Unable to download Docker images behind a proxy As a part of\u00a0our server management services, we use to handle several such Docker-related issues. You can also consult our technical team support for further assistance. Here in this blog we will see how to resolve this issue [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,127,68],"tags":[501],"class_list":["post-6339","post","type-post","status-publish","format-standard","hentry","category-blog","category-docker","category-server-management","tag-cannot-download-docker-images-behind-a-proxy"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=6339"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6339\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=6339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=6339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=6339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}