[root@node ~]# docker push 172.18.18.90:5000/busybox:v1
The push refers to repository [172.18.18.90:5000/busybox]
c5183829c43c: Pushed
v1: digest: sha256:c7b0a24019b0e6eda714ec0fa137ad42bc44a754d9cea17d14fba3a80ccc1ee4 size: 527
4.4 测试下载镜像
上传测试没问题了,我们接下来测试一下从registry服务器上下载刚才上传的busybox镜像,先删除node主机上的镜像:
[root@node ~]# docker rmi -f $(docker images -aq)
Untagged: 172.18.18.90:5000/busybox:v1
Untagged: 172.18.18.90:5000/busybox@sha256:c7b0a24019b0e6eda714ec0fa137ad42bc44a754d9cea17d14fba3a80ccc1ee4
Untagged: busybox:latest
Untagged: busybox@sha256:2107a35b58593c58ec5f4e8f2c4a70d195321078aebfadfbfb223a2ff4a4ed21
Deleted: sha256:f6e427c148a766d2d6c117d67359a0aa7d133b5bc05830a7ff6e8b64ff6b1d1d
Deleted: sha256:c5183829c43c4698634093dc38f9bee26d1b931dedeba71dbee984f42fe1270d
查看一下node主机上的镜像全部删除了:
[root@node ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
然后,从registry服务器上下载busybox镜像:
[root@node ~]# docker pull 172.18.18.90:5000/busybox:v1
v1: Pulling from busybox
d070b8ef96fc: Pull complete
Digest: sha256:c7b0a24019b0e6eda714ec0fa137ad42bc44a754d9cea17d14fba3a80ccc1ee4
Status: Downloaded newer image for 172.18.18.90:5000/busybox:v1
[root@node ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
172.18.18.90:5000/busybox v1 f6e427c148a7 36 hours ago 1.15MB
列出所有镜像:
[root@node ~]# curl :5000/v2/_catalog
{"repositories":["busybox"]}
列出busybox镜像有哪些tag:
[root@node ~]# curl :5000/v2/busybox/tags/list
{"name":"busybox","tags":["v1"]}
更多Docker相关教程见以下内容:
Docker安装应用(CentOS 6.5_x64) https://www.linuxidc.com/Linux/2014-07/104595.htm
Ubuntu 16.04 服务器上配置使用 Docker https://www.linuxidc.com/Linux/2017-06/145176.htm
Ubuntu 15.04下安装Docker https://www.linuxidc.com/Linux/2015-07/120444.htm
Docker 安装实例 https://www.linuxidc.com/Linux/2017-04/142666.htm
Docker 创建基础镜像 https://www.linuxidc.com/Linux/2017-05/144112.htm
在 Ubuntu 15.04 上如何安装Docker及基本用法 https://www.linuxidc.com/Linux/2015-09/122885.htm
Ubuntu 16.04上Docker使用手记 https://www.linuxidc.com/Linux/2016-12/138490.htm
使用Docker分分钟启动常用应用 https://www.linuxidc.com/Linux/2017-04/142649.htm
Ubuntu 16.04下Docker修改配置文件不生效解决办法 https://www.linuxidc.com/Linux/2017-05/143862.htm