1. Search for redis imagedocker search redis 2. Download the redis imagedocker pull redis:latest 3. Start the redis container --name The name of the container after startup docker run -itd --name redis --restart=always -p 6379:6379 -v /data/docker/redis/config:/etc/redis -v /data/docker/redis/data:/data redis redis-server /etc/redis/redis.conf --requirepass "123456" --appendonly yes Knowledge point expansion: Install redis using docker 1. Install Docker1. Check the kernel version, which must be 3.10 or above [root@localhost ~]# uname -r 2. Install Docker [root@localhost ~]# yum install docker 4. Start Docker [root@localhost ~]# systemctl start docker Check the version [root@localhost ~]# docker -v Docker version 1.12.6, build 3e8e77d/1.12.6 5. Start Docker on boot [root@localhost ~]# systemctl enable docker 6. Stop Docker [root@localhost ~]# systemctl stop docker 2. Install redisVisit: https://hub.docker.com/ Searching for redis we can see Download: docker pull redis command (slower) Recommended: Visit Docker China https://www.docker-cn.com/ Click Mirror Acceleration: You can see the following example: $ docker pull registry.docker-cn.com/library/ubuntu:16.04 Download redis //Use mirroring to speed up downloading redis docker pull registry.docker-cn.com/library/redis After downloading, view the image: docker images [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 Start redis docker run -d -p 6379:6379 --name myredis registry.docker-cn.com/library/redis View 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 <br>0.0.0.0:6379->6379/tcp myredis This is the end of this article about how to install redis in Docker. For more information about how to install redis in Docker, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: JavaScript implementation of the back to top button example
>>: How to implement vertical text alignment with CSS (Summary)
1 Introduction PostgreSQL is a free software obje...
Native js realizes the carousel effect (seamless ...
Situation description: The database was started a...
I won't say much nonsense, let's just loo...
Preface Most people will probably perform this op...
Preface Linux has corresponding open source tools...
Table of contents JavaScript Objects 1. Definitio...
I was recently working on a project at the compan...
inherit 1. What is inheritance Inheritance: First...
This article example shares the specific code of ...
How can we say that we should avoid 404? The reas...
Table of contents A murder caused by ERR 1067 The...
I wrote a test program before, in which adding and...
This article uses an example to describe the mana...
Source of the problem As we all know, all network...