<p>I am trying to pull an image from private registry and I have the auth stored in /root/.docker/config.json in a kubernetes cluster node. 
I have also verified that the auth works as expected while pulling the docker image. </p>

<pre class="lang-sh prettyprint-override"><code>curl -v \
     -X GET \
     -H "Authorization: Bearer $(cat /tmp/auth_bearer.txt)" repo-url/manifests/latest \
     -H "Accept: application/vnd.docker.distribution.manifest.v2+json"
</code></pre>

<p>Response: </p>

<pre class="lang-sh prettyprint-override"><code>&lt; HTTP/1.1 200 OK &lt; Date: Wed, 11 Mar 2020 23:27:09 GMT &lt;
Content-Type: application/vnd.docker.distribution.manifest.v2+json &lt;
Content-Length: 3455 &lt; Connection: keep-alive &lt; Vary: Origin &lt;
opc-request-id: 772f679098749bb474d59161 &lt; Docker-Content-Digest:
sha256:17dcbbf7c670d8894ddfefc2907c9f045bfc45e60954525635632abbf02910
&lt; {    "schemaVersion": 2,    "mediaType":
"application/vnd.docker.distribution.manifest.v2+json",    "config": {
      "mediaType": "application/vnd.docker.container.image.v1+json",
      "size": 9504,
      "digest": "sha256:d59db4a22d6ba8f1d3b5d7c8f8f410688dee569a947bf242e6c3e3b708f634829"
},    "layers": [
      { [...]
</code></pre>

<p>From the above response, it is clear that I have the image present at the private repo location and the auth is correct. However when I try to do <code>docker pull &lt;repo-url&gt;/image-name:image-tag</code> I get this error:</p>

<pre><code>Trying to pull repository &lt;repo-url&gt;/image-name:image-tag ... 
pull access denied for &lt;repo-url&gt;/image-name:image-tag, repository does not exist or may require 'docker login'
</code></pre>

<p>Can someone please tell me what I am missing here?
Why is the node ignoring docker credentials stored at /root/.docker/config.json?</p>

user4202236
<p><strong>Use file based config</strong></p>

<p>According to the documentation there is the following option: <a href="https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-registry" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/containers/images/#configuring-nodes-to-authenticate-to-a-private-registry</a></p>

<p>You can set the docker secrets in a file listed here:</p>

<ul>
<li><code>{--root-dir:-/var/lib/kubelet}/config.json</code></li>
<li><code>{cwd of kubelet}/config.json</code></li>
<li><code>${HOME}/.docker/config.json</code></li>
<li><code>/.docker/config.json</code></li>
<li><code>{--root-dir:-/var/lib/kubelet}/.dockercfg</code></li>
<li><code>{cwd of kubelet}/.dockercfg</code></li>
<li><code>${HOME}/.dockercfg</code></li>
<li><code>/.dockercfg</code></li>
</ul>

<blockquote>
  <p>Note: You may have to set HOME=/root explicitly in your environment file for kubelet.</p>
</blockquote>
