TarsCloud / Tars

Tars is a high-performance RPC framework based on name service and Tars protocol, also integrated administration platform, and implemented hosting-service via flexible schedule.
BSD 3-Clause "New" or "Revised" License
9.79k stars 2.08k forks source link

在Mac中使用docker安装mysql和部署tars framework会提示被拒 #810

Closed MasonYou closed 3 years ago

MasonYou commented 4 years ago

What language are you using?

What operating system (Linux, Ubuntu, …) and version?

MacOS Catalina v10.15.6

What runtime / compiler are you using (e.g. jdk version or version of gcc)

Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).

安装MySQL:

sh-3.2# docker run -d -p 3306:3306 \

--net=tars \
-e MYSQL_ROOT_PASSWORD="123456" \
--ip="172.25.0.2" \
-v /data/framework-mysql:/var/lib/mysql \
-v /etc/localtime:/etc/localtime \
--name=tars-mysql \
mysql:5.6

2f20e28e5b92aa55934a294a9f4282f2396a01d724628214545467b64b20bc77 docker: Error response from daemon: Mounts denied: The path /data/framework-mysql is not shared from OS X and is 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. .

部署tars-framework

sh-3.2# docker run -d \

--name=tars-framework \
--net=tars \
-e MYSQL_HOST="172.25.0.2" \
-e MYSQL_ROOT_PASSWORD="123456" \
-e MYSQL_USER=root \
-e MYSQL_PORT=3306 \
-e REBUILD=false \
-e INET=eth0 \
-e SLAVE=false \
--ip="172.25.0.3" \
-v /data/framework:/data/tars \
-v /etc/localtime:/etc/localtime \
-p 3000:3000 \
-p 3001:3001 \
tarscloud/framework:v2.4.0

e613eddaf5bac143d43b7c700f4f7647e6b0641bacfa9e902cf97b8c97ebbc33 docker: Error response from daemon: Mounts denied: The path /data/framework is not shared from OS X and is 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. .

即使我在preferences里面已经添加了shared paths /data/ 还是同样问题。 但是在docker dashboard 里面已经created了,但无法使用。

ruanshudong commented 4 years ago

docker: Error response from daemon: Mounts denied: 看起来是docker哪权限有问题, 估计得自己查一下

iinterest commented 3 years ago

MacOS Catalina 之后是无法在根目录创建文件及目录的,最好把你的文件映射挂载到你的用户目录下,例如:

...
-v /Users/YourUserName/docker/framework-mysql:/var/lib/mysql \
...