Laravel doesn’t generate a new key because can’t find APP_KEY

I need to clone an existing project into my new Docker-environment , but running php artisan key:generate always fails due to missing APP_KEY in .env, but it exists there and empty!

I tried php artisan config:clear and php artisan config:cached, but didn’t help as well.

Why could it happen and could it be a problem with my Docker container?

laravel app key error