国外镜像太慢了。可以找一个国内的。比如:https://hub.daocloud.io/ 【其它的应用安装我都是用的 阿里 镜像:https://cr.console.aliyun.com/】
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat9 latest f1338fd7a813 2 days ago 712MB
mysql 5.7 84164b03fa2e 7 days ago 456MB
centos latest 470671670cac 7 weeks ago 237MB
#daocloud.io/library/redis:3.2.9 后面不指定版本号,将会拉取最新版本,imags tag 里面会显示 latest
[root@localhost ~]# docker pull daocloud.io/library/redis:3.2.9
3.2.9: Pulling from library/redis
552d35eef8d3: Pull complete
1456a69aa136: Pull complete
1f49a48e1dbe: Pull complete
1875385cdd4d: Pull complete
f069bec08661: Pull complete
ba86db61d6ab: Pull complete
Digest: sha256:1abd60075275d7d821a885a4c6d835d7ff1c7a08854ec9a3a277d2847900d863
Status: Downloaded newer image for daocloud.io/library/redis:3.2.9
[root@localhost ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat9 latest f1338fd7a813 2 days ago 712MB
mysql 5.7 84164b03fa2e 7 days ago 456MB
centos latest 470671670cac 7 weeks ago 237MB
daocloud.io/library/redis 3.2.9 3459037fcc3a 2 years ago 98.9MB
[root@localhost ~]# docker run -d -p 6379:6379 --name redis3.2.9 daocloud.io/library/redis:3.2.9 --requirepass "123456"
542603098bbfd0686ffbf777d77485b5e1ae1ee89ed95774d1d800a7258784a1
#-d 守护进程运行(后台运行)
# -p 端口映射
#--name 容器名称
#daocloud.io/library/redis:3.2.9 容器名:TAG ,见 docker images 命令,如果pull有版本号,这边不指定版本号,将会重新pull一次最新版本,并启动
#--requirepass 设置密码
[root@localhost ~]#