Occ stuck with no output and 100% CPU after upgrading to nextcloud 20

Nextcloud version: 20.0.0
Operating system and version: nextcloud:fpm-alpine
Apache or nginx version: nginx:latest
PHP version: 7.3

Issue

After upgrading to Nextcloud 20, when running occ, the application will start but neither log anything nor return, being stuck at 100% CPU usage. Even a plain ./occ will not return. It does not matter whether occ is called from outside or from inside the container:

sudo docker exec -u 1000 nextcloud php occ

Note, that calling occ from OCCWeb works.

Is this the first time you’ve seen this error?: Y

Steps to replicate it:

  1. Upgrade from Nextcloud 19.0.0.3 to 20
  2. Try to run occ

The output of your Nextcloud log in Admin > Logging:

No log output generated by occ, nor any other error or informational message.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

No log output generated when callingocc.

The output of your Apache/nginx/system log in /var/log/____:

Not relevant, because no HTTP request is issued.

Seems to be a docker-only issue. See https://github.com/nextcloud/docker/issues/1267
Probably there will be some resolution there …