Closed Tseian closed 6 months ago
Add an env variable to locate current work dir or is there any other solution?
export XAGENT_WORK_DIR=$(pwd)
docker compose up
cd XAgent
vim docker-compose.yml
# replace DB_USERNAME: admin ; DB_PASSWORD: xagentmongodb ; DB_COLLECTION: TSM
# replace /root/XAgent/assets/config
: wq
from .env
DB_USERNAME: admin
DB_PASSWORD: xagentmongodb
DB_COLLECTION: TSM
From ./assets/config
to absolute path /root/XAgent/assets/config
volumes:
xagentmongodb:
toolserverconfig:
name: toolserverconfig
driver: local
driver_opts:
type: none
device: /root/XAgent/assets/config
o: bind
Add an env variable to locate current work dir or is there any other solution?
export XAGENT_WORK_DIR=$(pwd) docker compose up
Not fixed.
➜ XAgent git:(main) export XAGENT_WORK_DIR=$(pwd)
➜ XAgent git:(main) docker compose up
[+] Running 0/0
⠿ Volume "toolserverconfig" Error 0.0
Code version for 2024-1-28.
May fix: failed to mount local volume
Address content in:docker-compose.yml
cd XAgent vim docker-compose.yml # replace DB_USERNAME: admin ; DB_PASSWORD: xagentmongodb ; DB_COLLECTION: TSM # replace /root/XAgent/assets/config : wq
Example showed as below:
from .env
DB_USERNAME: admin DB_PASSWORD: xagentmongodb DB_COLLECTION: TSM
From
./assets/config
to absolute path/root/XAgent/assets/config
volumes: xagentmongodb: toolserverconfig: name: toolserverconfig driver: local driver_opts: type: none device: /root/XAgent/assets/config o: bind
From ./assets/config to absolute path /root/XAgent/assets/config
--> Solved.
Issue Description / 问题描述
(HTTP code 500) server error - Mounts denied: The path /assets/config is not shared from the host and is not known to Docker. You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing. See https://docs.docker.com/desktop/mac for more info.
Steps to Reproduce / 复现步骤
execute
docker compose up
in project root dirFile sharing settings look good. docker recognized the ./assets/config as /assets/config ?
Expected Behavior / 预期行为
Describe the behavior you expected to see. / 请描述您期望的正确行为。
Environment / 环境信息
Error Screenshots or Logs / 错误截图或日志
If possible, please provide relevant screenshots or logs of the error. / 如果可能,请提供相关的错误截图或日志文件。
Additional Notes / 其他备注