如何使用docker下载互联网上的镜像并导出
1、开始之前需要在docker hub上注册账号,只有注册了账号后才可以在在dockerhub上上传或下载docker的镜像文件。

3、使用docker search命令搜索hub库上的镜像资源,如我们需要下载docker hello-world可以使用如下命令,查询结果会返回一个列表hxb@omg:~$ sudo docker search hello-world

5、下载的hello-world镜像文件存储在本地的什么位置?这里给出一个查找的方法进入docker目录docker默认的安装蚕蝣鲢蹙目录是/var/lib/docker,查看/var/lib/docker/image/overlay2/repositories.json文件可以看到hello-world的内容。root@omg:/var/lib/docker/image/overlay2# cat repositories.json{"Repositories":{"hello-world":{"hello-world:latest":"sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e","hello-world@sha256:4fe721ccc2e8dc7362278a29dc660d833570ec2682f4e4194f4ee23e415e1064":"sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e"},"ubuntu":{"ubuntu:latest":"sha256:0cfc1cdcca3ddda7d37f481c3949541d614a2213fa42a0206179655908edbe0c","ubuntu@sha256:7a47ccc3bbe8a451b500d2b53104868b46d60ee8f5b35a24b41a86077c650210":"sha256:47b19964fb500f3158ae57f20d16d8784cc4af37c52c49d3b4f5bc5eede49541"}}}root@omg:/var/lib/docker/image/overlay2#

7、测试运行hello-world镜像hxb@omg:~$ sudo docker run hello-world
