英文:
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文件中提供了错误的路径。
- 请仔细检查路径,确保它存在于你的macOS目录中...你可以通过进入错误消息中提供的路径来检查。
- 检查
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
- 在进行更改后,首先保存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.
-
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.
-
Check the
docker-compose.yml
file whether you gave the path correct. Look for thevolumes
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
-
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论