Home > OS >  Build and Push Docker Image to Docker Hub- UnAuthorised
Build and Push Docker Image to Docker Hub- UnAuthorised

Time:09-14

I have a git repository from where I am trying to build and publish a docker image to docker hub. Some how I am keep on getting Unauthorised for docker login step.

Any Help is appreciated.

GitHub Repo : https://github.com/Git-Beginner/ghaction/actions

CodePudding user response:

You should first login to docker hub by typing the command docker login it will prompt the user name and after that password of docker hub after that try pushing the image again to docker hub

CodePudding user response:

I am not that sure if this is what you have asked for but in order to push images to docker hub , first you need to build your docker image. then create a repository on docker hub with the name you want. and then do something like this

docker build -f ./Dockerfile -t nametoyourlocalimage:version .    //this will build your docker image locally
docker tag nametoyourlocalimage:version YourDockerHubNewReporUrlYouJUstCreated

docker login  //this will prompt you to enter your username and password
docker push YourDockerHubNewRepoUrlYouJUstCreated
docker logout
  • Related