1 , check the kernel version must be 3.10 or more [the root @ localhost ~] # the uname - R & lt 2 , mounted Docker [the root @ localhost ~] # yum the install Docker . 4 , starting Docker [the root @ localhost ~ ] # systemctl Start Docker See version [root @ localhost ~] # Docker - v Docker version 1.12 . 6 , Build 3e8e77d / 1.12 . 6 5 , boot Docker [root @ localhost ~ ] # systemctl enable Docker 6 , stop Docker [root @ localhost~]# systemctl stop docker
Click image acceleration: you can see the following example:
docker pull registry.docker-cn.com/library/ubuntu:16.04
Download redis
// use the mirror to accelerate download Redis Docker pull registry.docker-cn.com/library/redis
[root@VM_0_4_centos ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE redis latest 01a52b3b5cd1 2 weeks ago 98.2MB
docker run --name redis -p 6379:6379 -v /root/docker/redis/data:/data -d redis redis-server --appendonly yes
Command line parameters involved
-d -> way to start the daemon container -p 6379 : 6379 -> bind host port --name myredis -> specify the container name --restart always -> boot --privileged = to true -> upgrade the container permission -v /root/docker/redis/conf:/etc/redis/redis.conf -> mapping configuration file -v / root / docker / redis / data: / data -> map data directory --appendonly yes -> open data persistence