1. Pull the official 5.0.3 image [root@localhost ~]# docker pull redis:5.0.3 Download Complete [root@localhost ~]# docker pull redis:5.0.3 5.0.3: Pulling from library/redis f7e2b70d04ae: Pull complete 421427137c28: Pull complete 4af7ef63ef0f: Pull complete b858087b3517: Pull completed 2aaf1944f5eb: Pull complete 8270b5c7b90d: Pull complete Digest: sha256:4be7fdb131e76a6c6231e820c60b8b12938cf1ff3d437da4871b9b2440f4e385 Status: Downloaded newer image for redis:5.0.3 2. Create a mount directory 1. Create a mount folder [root@localhost ~]# mkdir -p /root/redis/data /root/redis/conf [root@localhost ~]# cd redis/ [root@localhost redis]# ls conf data 2. Create redis.conf Create the file redis.conf in the /root/redis/conf directory touch redis.conf Show Catalog [root@localhost redis]# cd conf/ [root@localhost conf]# ls [root@localhost conf]# touch redis.conf [root@localhost conf]# ls redis.conf [root@localhost conf]# 3. Create a redis container docker run -d --name redis -p 6379:6379 -v /root/redis/conf/redis.conf:/redis.conf -v /root/redis/data:/data redis:5.0.3 redis-server --appendonly yes Parameter Description: -d Run in the background -p port mapping to the host port -v mounts the host directory to the container's directory redis-server --appendonly yes : Execute the redis-server startup command in the container and turn on the redis persistence configuration 1. Start redis The error reported during startup is as follows: [root@localhost ~]# docker run -d --name redis -p 6379:6379 -v /root/redis/conf/redis.conf:/redis.conf -v /root/redis/data:/data redis:5.0.3 redis-server --appendonly yes 9bc537c19ff0ad76727b5215da8cba4223c5ff97f1d9a53585d573ca71fd8c0c docker: Error response from daemon: driver failed programming external connectivity on endpoint redis (fa297144f8d0c958288bb35a94ffbec545d348f2ff9f55a5b573f3d9a0354ace): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 6379 -j DNAT --to-destination 172.17.0.3:6379 ! -i docker0: iptables: No chain/target/match by that name. (exit status 1)). Note: The custom chain DOCKER defined when the docker service is started is cleared for some reason. Restart the docker service and regenerate the custom chain DOCKER Solution: Step 1. Restart Docker. Step 2: Start the container; systemctl restart docker docker start foo 2. The container is created successfully and the redis container is started docker start redis 1. Startup failure problem: When starting the container, an error message appears: iptables: No chain/target/match by that name The rough solution is to restart Docker 2. Normal startup and display 4. Client connection I use RedisDesktopManager The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Full steps to create a password generator using Node.js
>>: Various problems encountered by novices when installing mysql into docker
Table of contents 1. Usage 1. Basic usage 2. The ...
This effect is most common on our browser page. L...
Preface This article introduces the use of vue-ro...
This article shares the specific code of Vue to i...
When you are working on a shared system, you prob...
Table of contents Preface What is a virtual list?...
Summary of common functions of PostgreSQL regular...
#include <asm/io.h> #define ioremap(cookie,...
If you want to insert 5 records into table1, the ...
To install Jenkins on CentOS 8, you need to use t...
Let's take a look at the code file structure ...
<br />Previous article: Web Design Tutorial ...
Programmers must deal with MySQL a lot, and it ca...
1. View the current host name [root@fangjian ~]# ...
I'm currently learning about front-end perform...