简体   繁体   中英

how to push changes to docker hub?

1) I have pushed image to docker hub with

docker push ucanmiracle/docker-learn:node-test-image

2) Added changes to my project file

3) pushing docker image with

docker push ucanmiracle/docker-learn:node-test-image1

But project changes didn't applied. How to properly push updates to docker hub?

You don't push project files to the registry, you push an image, which needs to be built from the project files first.

1: Run docker build -t ucanmiracle/docker-learn:node-test-image1 . It will build the image from the Dockerfile in current directory and tag it as ucanmiracle/docker-learn:node-test-image1 .

2: Then you run docker push ucanmiracle/docker-learn:node-test-image1 to push the image to Docker Hub.

Check this Link for more on building Docker images.

Step1:

Run below cmd from the folder where Dockerfile resides

docker build -t name_of_ image_with_version local_docker_dir_path

Ex:$ docker build -t base:1.0.0  .

Step2:

Get the docker image Tag id by running below cmd

$ docker images

if you are using docker.io ( dockerhub repo ), you need to tag it including the name docker.io in it.

docker tag ${image_id} docker.io/${login_name}/${image_name}

Ex: docker tag 86xc1fxyzabc9 docker.io/someone/image_name_in_docker_io

and then

docker push docker.io/${login_name}/${image_name}

Ex: docker push docker.io/someone/image_name_in_docker_io

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