I'm using docker-java
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 docker-java
. But when I try to push the image to a private registry(Harbor) I get
com.github.dockerjava.api.exception.DockerClientException: Could not push image: denied: requested access to the resource is denied
I have added my current user to the usergroup docker
and can manually push the image with the following command from the terminal(note no sudo).
docker login
docker push some_ip/app/test:test
But when I make the following call from my java code I get the above mentioned error.
dockerClient.pushImageCmd("10.107.173.190/container-apps/test:testapp")
.exec(pushImageResultCallback).awaitSuccess();
Possible cues:
- Which profile does docker daemon use when being invoked by the API? How can I make sure it has sufficient access?