Docker : How to push docker image to docker hub – resolving error – “denied: requested access to the resource is denied”

Hi All,
Greetings for the day 🙂 LIFE IS BEAUTIFUL 🙂
Today new issue and resolution 🙂
Background :
- I was preparing an article for setting up Kubernetes cluster in local environment for demo / learning
- In one of our previous article – Docker – Introduction to Containers and Docker – part 2 – Creating first Docker program – our first container with detailed steps 🙂 we have created our first docker image / container
- So I need to create local Kubernetes cluster and deploy our first docker image / container
- To deploy our docker image in Kubernetes cluster we need to store somewhere so that get pulled and deployed in Kubernetes cluster
- I am trying to push our docker image in docker hub and getting an error
- I am using my ubuntu vm created on free/trial Azure subscription
Error / Issue :
denied: requested access to the resource is denied
Solution:
- After googling bit and reading I found that there are certain steps/rules which we need to follow to publish our image to docker hub
- We need to tag our docker image using docker tag command
prasham@KnowledgeJunction-Ubuntu:~$ docker tag knowledgejunction prashamsabadra/knowledgejunction
- Once we tagged our image we need login with our Docker ID
- If we don’t have Docker ID we can create our docker id from the site – https://hub.docker.com/ as

- Here, please notice I have my docker id – prashamsabadra
- Log in to docker hub using our docker id using command docker login
prasham@KnowledgeJunction-Ubuntu:~$ docker login
- Once we successfully logged in, we are ready to push our docker image using docker push command
prasham@KnowledgeJunction-Ubuntu:~$ docker push prashamsabadra/knowledgejunction:latest
- Here, please note that name of our image is our dockerid/imagename => prashamsabadra/knowledgejunction
Thanks 🙂
STAY HEALTHY 🙂 STAY SAFE 🙂
You must log in to post a comment.