In case you are building a Docker container with an older PHP 8.0 version and you need mongodb extension, then you may see this error during the container build process:
pecl/mongodb requires PHP (version >= 8.1.0, version <= 8.99.99), installed version is 8.0.x
The problem is that your Dockerfile has pecl install mongodb, which installs the latest version. If we look on the PHP pecl mongodb link, we will see at the end of the page the following dependencies section:
Continue reading