1、检查内核版本,必须是3.10及以上 [root@localhost ~]# uname -r 2、安装docker [root@localhost ~]# yum install docker 4、启动docker [root@localhost ~]# systemctl start docker 查看版本 [root@localhost ~]# docker -v Docker version 1.12.6, build 3e8e77d/1.12.6 5、开机启动docker [root@localhost ~]# systemctl enable docker 6、停止docker [root@localhost ~]# systemctl stop docker
搜索redis 我们可以看到
下载: docker pull redis 命令(速度较慢)
点击镜像加速 :可以看到如下示例:
$ docker pull registry.docker-cn.com/library/ubuntu:16.04
//使用镜像加速下载redis docker pull registry.docker-cn.com/library/redis
[root@VM_0_4_centos ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE registry.docker-cn.com/library/redis latest 4e8db158f18d 2 weeks ago 83.4 MB
docker run -d -p 6379:6379 --name myredis registry.docker-cn.com/library/redis
[root@VM_0_4_centos ~]# docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 7512230290be registry.docker-cn.com/library/redis "docker-entrypoint..." 22 hours ago Up 22 hours
0.0.0.0:6379->6379/tcp myredis