How to install redis in Docke

How to install redis in Docke

1. Search for redis image

docker search redis

2. Download the redis image

docker pull redis:latest

3. Start the redis container

--name The name of the container after startup
--restart=always restart automatically
-p port mapping
-v directory mount
--requirepass login password

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 Docker

1. 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 redis

Visit: 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:
  • Detailed explanation of installing redis in docker and starting it as a configuration file
  • How to install redis in docker and set password and connect
  • How to install redis5.0.3 in docker
  • Docker installs redis 5.0.7 and mounts external configuration and data issues
  • How to deploy redis in linux environment and install it in docker
  • Docker installs the official Redis image and enables password authentication
  • How to install common components (mysql, redis) in Docker

<<:  JavaScript implementation of the back to top button example

>>:  How to implement vertical text alignment with CSS (Summary)

Recommend

Running PostgreSQL in Docker and recommending several connection tools

1 Introduction PostgreSQL is a free software obje...

Native js to achieve seamless carousel effect

Native js realizes the carousel effect (seamless ...

mySql SQL query operation on statistical quantity

I won't say much nonsense, let's just loo...

5 Easy Ways to Free Up Space on Ubuntu

Preface Most people will probably perform this op...

The implementation process of Linux process network traffic statistics

Preface Linux has corresponding open source tools...

JavaScript Objects (details)

Table of contents JavaScript Objects 1. Definitio...

MySQL cleverly uses sum, case and when to optimize statistical queries

I was recently working on a project at the compan...

Three methods of inheritance in JavaScript

inherit 1. What is inheritance Inheritance: First...

Vue implements book management case

This article example shares the specific code of ...

17 404 Pages You'll Want to Experience

How can we say that we should avoid 404? The reas...

Solution to mysql error when modifying sql_mode

Table of contents A murder caused by ERR 1067 The...

Solution to the problem that input in form cannot be submitted when disabled

I wrote a test program before, in which adding and...

Summary of pitfalls in importing ova files into vmware

Source of the problem As we all know, all network...