Redis教程

mac docker安装redis 含挂载

本文主要是介绍mac docker安装redis 含挂载,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
ivys-MacBook-Pro:~ txp$ cd docker
ivys-MacBook-Pro:docker txp$ ls
redis
ivys-MacBook-Pro:docker txp$ cd redis
ivys-MacBook-Pro:redis txp$ ls
ivys-MacBook-Pro:redis txp$ mkdir -p conf
ivys-MacBook-Pro:redis txp$ ls
conf
ivys-MacBook-Pro:redis txp$ mkdir -p data
ivys-MacBook-Pro:redis txp$ ls
conf	data



sudo docker run -p 6379:6379 --name redis -v /Users/txp/docker/redis/conf:/etc/redis/redis.conf -v /Users/txp/docker/redis/data:/data -d redis redis-server /etc/redis/redis.conf --appendonly yes
Password:
Unable to find image 'redis:latest' locally
latest: Pulling from library/redis
42c077c10790: Already exists 
a300d83d65f9: Already exists 
ebdc3afaab5c: Already exists 
312c02ded1dd: Pull complete 
604377b42ad5: Pull complete 
994e00ada2d1: Pull complete 
Digest: sha256:96c5620546f79b323866e7107406d165ec1020f0754b2fe2fc3067938a085841
Status: Downloaded newer image for redis:latest
4b01db4c2b7163e71a26b1e8ca2871f666130a2dd9777cca77a348264839762d
ivys-MacBook-Pro:~ txp$ docker ps
CONTAINER ID   IMAGE          COMMAND                  CREATED          STATUS          PORTS                    NAMES
4b01db4c2b71   redis          "docker-entrypoint.s…"   29 seconds ago   Up 28 seconds   0.0.0.0:6379->6379/tcp   redis
bab7ce9eac7a   mysql:5.7.21   "docker-entrypoint.s…"   30 minutes ago   Up 30 minutes   0.0.0.0:3306->3306/tcp   mysql57
0aee584b12bd   nginx          "/docker-entrypoint.…"   44 minutes ago   Up 43 minutes   0.0.0.0:80->80/tcp       nginx

  

这篇关于mac docker安装redis 含挂载的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!