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
搜索redis 咱們能夠看到docker
下載: docker pull redis 命令(速度較慢)ubuntu
centos
點擊鏡像加速 :能夠看到以下示例:tcp
$ 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