title: Could not push image: denied: requested access to the resource is denied
body: <p>I'm using <code>docker-java</code> to create an image on a docker host which is running on a Ubuntu 16.04 VM. The image creation works just fine and I can list the image created via <code>docker-java</code>. But when I try to push the image to a private registry(Harbor) I get</p>
  
  <pre><code>com.github.dockerjava.api.exception.DockerClientException: Could not push image: denied: requested access to the resource is denied
  </code></pre>
  
  <p>I have added my current user to the <code>usergroup docker</code> and can manually push the image with the following command from the terminal(note no sudo).</p>
  
  <pre><code>docker login
  docker push some_ip/app/test:test
  </code></pre>
  
  <p>But when I make the following call from my java code I get the above mentioned error.</p>
  
  <pre><code>dockerClient.pushImageCmd("10.107.173.190/container-apps/test:testapp")                  
                      .exec(pushImageResultCallback).awaitSuccess();
  </code></pre>
  
  <p><strong>Possible cues:</strong></p>
  
  <ul>
  <li>Which profile does docker daemon use when being invoked by the API? How can I make sure it has sufficient access?</li>
  </ul>