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)
Recently the company has arranged to do some CCFA...
Preface Slow query log is a very important functi...
Links to the current page. ------------------- Com...
Table of contents Preface Introduction to QueryCa...
There are three ways to create an image: creating...
Effect html <div class="sp-container"...
1. What is the use of slow query? It can record a...
Download url-loader yarn add -D url-loader module...
Some time ago, when I was working on a small func...
Table of contents 1. Background 2. Prerequisites ...
Compared with vue2, vue3 has an additional concep...
MySQL CURDATE Function Introduction If used in a ...
In the pages of WEB applications, tables are ofte...
Table of contents 1. Introduction 2. Usage Statel...
Table of contents 1. Preprocessing 2. Compilation...