Docker安装Redis关于Mounts denied解决

在使用Docker镜像redis时映射配置文件和映射数据目录的时候,出现如下错误提示:

docker: Error response from daemon: Mounts denied: 
The paths /docker/redis/data and /docker/redis/redis.conf
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.

  解决办法:在目录下面-v后面跟的目录使用绝对路径

docker run -d -p 6379:6379 -v $(pwd)/docker/redis/redis.conf:/etc/redis/redis.conf -v $(pwd)/docker/redis/data:/data --name my-redis redis:latest redis-server /etc/redis/redis.conf

  

posted @ 2019-10-23 16:51  技术博客这里开始  Views(2381)  Comments(1Edit  收藏  举报