在已运行的应用中安装sail依赖时,除了确保删除之前新建项目的vendor目录外,还要先执行sail down才行,不然报错:Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/xxxx" to rootfs at "/docker-entrypoint-initdb.d/10-create-testing-database.sh": mount /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/xxxx:/docker-entrypoint-initdb.d/10-create-testing-database.sh (via /proc/self/fd/9), flags: 0x5000: no such file or directory: unknown
这个地方讲的不是很清楚,应该是用户clone一个项目后,项目中是没有vendor目录的,需要通过
docker run --rm \
-u "$(id -u):$(id -g)" \
-v "$(pwd):/var/www/html" \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
上述代码安装扩展包
感谢朋友的补充,有大家的补充,有遗留的地方基本也能完善起来
在已运行的应用中安装sail依赖时,除了确保删除之前新建项目的vendor目录外,还要先执行sail down才行,不然报错:Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/xxxx" to rootfs at "/docker-entrypoint-initdb.d/10-create-testing-database.sh": mount /run/desktop/mnt/host/wsl/docker-desktop-bind-mounts/Ubuntu/xxxx:/docker-entrypoint-initdb.d/10-create-testing-database.sh (via /proc/self/fd/9), flags: 0x5000: no such file or directory: unknown
感谢老朋友的补充,不然以我个人有限的精力,是无法帮大家踩这么多坑,总结这些问题的解决方案的。