Theodorus Agum Gumilang
Theodorus Agum Gumilang

Reputation: 1486

How to create image and push image to docker hub

I want to push my microservice to dockerhub but i dont know how to push it to docker hub, after docker login then im using docker push then its go this message

The push refers to a repository [docker.io/library/microservicehelloworld]
An image does not exist locally with the tag: microservicehelloworld

and then im using

docker tag microservicehelloworld  microservicehelloworld

and it shows error message like this

Error response from daemon: No such image: microservicehelloworld:latest

here is my full solution, is there any file missing , or something that i must do to create docker image ? enter image description here

Upvotes: 0

Views: 118

Answers (2)

Aamir M Meman
Aamir M Meman

Reputation: 1841

Step 1 : Please create your account in hub.docker.com. , with your user name.

Step 2 : Build your image locally using your Dockerfile $ docker build -t="mysql_mac" -f mysql_dockerfile .,In these case my image name is mysql_mac

Step 3 : It will create the image called mysql_mac and now tag it and push to hub.docker.com

Step 4 : $ docker tag mysql_mac aamir2292/mysql_mac. Note my login name is aamir2292 on docker-hub.

Step 5 : $ docker push aamir2292/mysql_mac

Congrats You have created a mysql image.

Upvotes: 1

Sergiu
Sergiu

Reputation: 3195

Inside the directory where you've got the Dockerfile you will need to do a build like:

docker build -t microservicehelloworld . 

and then tag is as follows:

docker tag microservicehelloworld docker.io/library/microservicehelloworld

and finally you will be able to push it:

docker push docker.io/library/microservicehelloworld

Upvotes: 0

Related Questions