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

  

原创文章,作者:kepupublish,如若转载,请注明出处:https://blog.ytso.com/267383.html

(0)
上一篇 2022年6月15日
下一篇 2022年6月15日

相关推荐

发表回复

登录后才能评论