If PHP is inside a Docker container, then composer commands should also be run inside the container.
You can also try to execute commands inside the container in the root directory of the symfony project.
php bin/console cache:clear
composer dump-autoload -o