数据库
首页 > 数据库> > 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

  

标签:Pro,redis,ivys,mac,docker,MacBook,txp
来源: https://www.cnblogs.com/duwamish/p/16370822.html