简体   繁体   中英

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 ? 在此处输入图片说明

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM