It appears that I was running the CLI command from my computer's command line. So first I had to connect into my Docker container using
docker-compose exec php bash
And then all the commands runs just fine. :)