'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.

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. Switching back to PHP7.4 solves the problem. Others in the team (Windows and macOS) do not have this issue.

Big Sur 11.6.4 - slow
Monterey 12.3 - slow
Monterey 12.1 - fine

No idea where to even start looking - any ideas?



Solution 1:[1]

Found it eventually, posting an answer in case it helps anyone else.

Adding the following variables to docker-compose.yml resolved the issue.

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Steve