工具: win10系统 、docker toolbox
1、从docker hub注册账号
2 、打开docker toolbox
2、docker toolbox上登录
docker login
3、查询要寻找的镜像
4、下拉hello_world 镜像
选择stars最多的那一个,也是docker实战中的实例
docker pull dockerinaction/hello_world
(下载过程有点乱(・ω・`ll))
5、查看本地镜像
docker images
说明hello_world镜像以下载到了本地
6、运行hello_world镜像
docker run dockerinaction/hello_world
运行hello_world镜像成功
过程中需要注意 (1)每次打开docker工具后,登录docker login,登录有可能失败,这个原因是docker hub是国外网站,访问比较慢,可能会超时,或访问不到。 多次尝试即可。
(2)从docker hub上 下拉镜像有时会超时或者失败,原因有二:
一:网络原因,
解决办法 : a、反复尝试
b、使用国内仓库(后续文章中会讲到配置国内仓库)
二:远程仓库中没有该镜像
解决办法:下拉镜像之前,先查看是有该镜像 ,使用命令:docker search <镜像名>
说明:学习最好使用Linux系统,最起码比toolbox使用简单