官术网_书友最值得收藏!

  • Learn OpenShift
  • Denis Zuev Artemii Kropachev Aleksey Usov
  • 202字
  • 2021-08-13 16:03:46

Uploading images to the Docker registry

Now we know how to search, pull, remove, save, load, and list available images. The last piece we are missing is how to push images back to Docker Hub or a private registry.

To upload an image to Docker Hub, we need to do a few tricks and follow these steps:

  1. Log in to Docker Hub:
$ docker login
Username: #Enter your username here
Password: #Enter your password here
Login Succeeded
  1. Copy the Docker image you want to push to a different path in the Docker repository on your server:
$ docker tag httpd:latest flashdumper/httpd:latest
Note that flashdumper is your Docker Hub username.
  1. Finally, push the copied image back to Docker Hub:
$ docker push flashdumper/httpd:latest

The output of the preceding command will be as shown in the following screenshot:

Now the image is pushed to your Docker Hub and available for anyone to download. 

$ docker search flashdumper/*

The output of the preceding command will be as shown in the following screenshot:

You can check the same result using a web browser. If you go to https://hub.docker.com/ you should be able to see this httpd image available under your account:

Docker Hub account images
主站蜘蛛池模板: 惠州市| 六盘水市| 林甸县| 镇平县| 康马县| 安丘市| 石河子市| 山丹县| 巴东县| 隆安县| 长治县| 民县| 越西县| 临颍县| 武山县| 大埔县| 万宁市| 卢湾区| 象州县| 观塘区| 繁昌县| 桓台县| 浏阳市| 古丈县| 胶州市| 瓦房店市| 商城县| 丘北县| 大厂| 和平区| 津南区| 陇南市| 盖州市| 武穴市| 临武县| 奉新县| 余庆县| 苍溪县| 麻城市| 河间市| 离岛区|