问题:公司内网机器没有外网,不能直连Docker Hub使用docker pull命名拉取镜像。
解决:找一台可以连接外网的机器,从Docker Hub拉取镜像后,打包并传至内网机器,再加载镜像。
步骤:
1)在外网机器上docker pull拉取镜像
[root@VM ~]# docker pull nextcloud [root@VM ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE docker.io/nextcloud latest 0fe79776ccc8 8 days ago 880 MB p9ip4xdx.mirror.aliyuncs.com/osixia/openldap 1.5.0 2da3cf664891 15 months ago 257 MB [root@VM ~]#
2)打包镜像
[root@VM ~]# docker save -o nextcloud.tar docker.io/nextcloud:latest [root@VM ~]# ls -ltr 总用量 902772 -rw------- 1 root root 908005376 6月 7 11:11 nextcloud.tar [root@VM ~]#
3)拷贝镜像至公司内网机器
4)在内网机器上面加载镜像
[root@VM ~]# docker load -i nextcloud.tar
5)内网机器查看镜像
[root@VM ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE nextcloud latest 0fe79776ccc8 8 days ago 880 MB



