简体   繁体   English

Docker 在 PHP 7.4 > 8 更新后在 mac 上运行真的很慢

[英]Docker running really slow on mac after PHP 7.4 > 8 update

We've recently updated our docker config from PHP7.4 to PHP8 running on Ubuntu 20.04.我们最近将我们的 docker 配置从 PHP7.4 更新到运行在 Ubuntu 20.04 上的 PHP8。

For most of the team this has been fine.对于大多数团队来说,这很好。 For me and one other (both using mac) our local env is now running noticably slower.对于我和其他人(都使用 mac),我们的本地环境现在运行速度明显变慢。 Switching back to PHP7.4 solves the problem.切换回 PHP7.4 解决了问题。 Others in the team (Windows and macOS) do not have this issue.团队中的其他人(Windows 和 macOS)没有这个问题。

Big Sur 11.6.4 - slow大苏尔 11.6.4 - 慢
Monterey 12.3 - slow蒙特雷 12.3 - 慢
Monterey 12.1 - fine蒙特雷 12.1 - 很好

No idea where to even start looking - any ideas?甚至不知道从哪里开始寻找 - 有什么想法吗?

Found it eventually, posting an answer in case it helps anyone else.最终找到它,发布一个答案以防它帮助其他人。

Adding the following variables to docker-compose.yml resolved the issue.将以下变量添加到docker-compose.yml解决了这个问题。

services:
    laravel.test:
        environment:
            XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
            XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM