{"id":6615,"date":"2021-07-07T17:09:43","date_gmt":"2021-07-07T11:39:43","guid":{"rendered":"https:\/\/www.skynats.com\/?p=6615"},"modified":"2021-09-21T16:46:33","modified_gmt":"2021-09-21T11:16:33","slug":"how-to-fix-the-docker-error-x509","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/how-to-fix-the-docker-error-x509\/","title":{"rendered":"How To Fix The Docker Error x509?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This is a common docker error when trying to log into their docker registry and the error looks like &#8220;x509: certificate signed by unknown authority&#8221;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our Technical team are available to fix all the issues related to Docker and Docker Management.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Cause of this Issue :<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This error happens when you are using a self-signed certificate for your docker registry instead of the certificate issued by the trusted certificate authority (CA). Then the docker daemon will not trust your self-signed certificate and it will lead to the x509 error.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Diagnose the Issue :<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can recreate the issue by trying to log into the docker using the below command ;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker login &lt;docker_registry_host&gt;:&lt;docker_registry_port&gt; -u user -p password \n\nEg :\n\ndocker login skynats.com:5666 -u admin -p pass@123<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In case of this certificate issue you will get the below error ;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Error response from daemon : Get https:\/\/skynats.com:5666\/v2\/: x509 certificate signed by unknown authority<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>To Resolve the Issue :<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We can make the docker trust the self-signed certificate by copying the self-signed certificate to the &#8220;\/etc\/docker\/certs.d\/&lt;docker_registry_hostname&gt;:&lt;docker_registry_host_port&gt;\/ca.crt&#8221; on the machine where you are trying to run the docker login command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can follow the below steps to solve this issue ;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Create the following directory on the server from which you are trying to run the docker login command. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/etc\/docker\/certs.d\/&lt;dcoker_registry_host&gt;:&lt;docker_registry_host_port&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Copy your Docker registry certificate file from your docker registry host to the cluster where you are running docker login.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You should rename your registry certificate file to &#8220;\/etc\/docker\/certs.d\/&lt;docker_registry_host&gt;:&lt;docker_registry_host_port&gt;\/ca.crt&#8221;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>scp &lt;your_registry_hostname&gt;:\/opt\/registry\/certs\/domain.crt \/etc\/docker\/certs.d\/&lt;docker_registry_host&gt;:&lt;docker_registry_host_port&gt;\/ca.crt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example ;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/etc\/docker\/certs.d\/skynats.com:5666\n\nscp skynats.com:\/opt\/registry\/certs\/domain.crt \/etc\/docker\/certs.d\/skynats.com:5666\/ca.crt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">3. Then you can try to login into your docker registry again.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need any further assistance related to Docker our <a href=\"https:\/\/www.skynats.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener\"><span style=\"color:#04789f\" class=\"has-inline-color\">technical team <\/span><\/a>will help you at any time. Contact Us right now<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a common docker error when trying to log into their docker registry and the error looks like &#8220;x509: certificate signed by unknown authority&#8221;. Our Technical team are available to fix all the issues related to Docker and Docker Management. Cause of this Issue : This error happens when you are using a self-signed [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,127],"tags":[84,427,88],"class_list":["post-6615","post","type-post","status-publish","format-standard","hentry","category-blog","category-docker","tag-apache-docker-images","tag-docker-issues","tag-docker-support"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6615","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=6615"}],"version-history":[{"count":0,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/6615\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=6615"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=6615"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=6615"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}