如何在 macOS 上运行带有 Odoo 的 Docker 配置时解决 ‘invalid mount config’ 错误?

huangapple go评论104阅读模式
英文:

How to resolve 'invalid mount config' error when running a Docker config with Odoo on macOS?

问题

这是我第一次使用Docker,我想要使用Docker安装Odoo。当我完成创建docker-compose.yaml文件并使用命令"docker-compose up -d"时,我总是遇到如下错误。

⠋ 容器odoo-db-1 创建中 0.0秒
守护进程的错误响应:类型"bind"的挂载配置无效:绑定源路径不存在:/host_mnt/Users/sariaz/Documents/odoo/odoo_pg_pass

我正在使用macOS Big Sur运行Docker,并已经为Docker和终端授予了完全磁盘访问权限。然而,同样的错误仍然存在。

英文:

This is my first time using Docker, and I want to install Odoo with Docker. When I finish creating the docker-compose.yaml file and use the command "docker-compose up -d," I always encounter an error like this.

⠋ Container odoo-db-1  Creating                                           0.0s 
Error response from daemon: invalid mount config for type "bind": bind source path does not exist: /host_mnt/Users/sariaz/Documents/odoo/odoo_pg_pass

I am using macOS Big Sur to run Docker, and I have already granted full access to the disk for Docker and the Terminal. However, the same error still persists.

答案1

得分: 0

你看到的错误消息表明在你的主机上找不到该路径,或者在docker-compose.yml文件中提供了错误的路径。

  1. 请仔细检查路径,确保它存在于你的macOS目录中...你可以通过进入错误消息中提供的路径来检查。
  2. 检查docker-compose.yml文件,确认路径是否正确。查找volumes部分并确认源路径是否与你本地目录上的实际路径匹配。
volumes:
   - /host_mnt/Users/sariaz/Documents/odoo_pg_pass:/YOUR_PATH_1/YOUR_PATH_2/YOUR_PATH_3/odoo_pg_pass
  1. 在进行更改后,首先保存docker-compose.yml文件,然后再运行它。此外,重新启动Docker也有用。有时候你需要使用以下命令来清除Docker缓存:
docker system prune
英文:

Error message that you're seeing indicates that the path doesn't exist on your host machine or you gave the wrong path in docker-compose.yml file.

  1. Double check the path, whether it exists in your macOS directory... You can do it by going in to the given path in the error message.

  2. Check the docker-compose.yml file whether you gave the path correct. Look for the volumes section and confirm source path matches the actual path on your local directory.

    volumes:
       - /host_mnt/Users/sariaz/Documents/odoo_pg_pass:/YOUR_PATH_1/YOUR_PATH_2/YOUR_PATH_3/odoo_pg_pass
    
  3. After making changes, first save the docker-compose.yml file before running it. Additionally restarting the Docker is also useful. And sometimes you have to clear the Docker cache with the following command:

docker system prune

huangapple
  • 本文由 发表于 2023年5月29日 12:13:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76354635.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定