Are the files of your commands themselves in the Docker container? Maybe it's related to Docker build cache?
Custom Artisan Commands Missing in Docker After Laravel 11 Upgrade
Hi everyone,
After upgrading my Laravel project from version 10 to 11, I noticed that my custom Artisan commands are no longer showing up in my local Docker environment. This used to work without any issues in Laravel 10.
I tested the same setup with a fresh Laravel 12 project running in Docker, and the problem persists. However, when I run the exact same project on my production server (which is not Dockerized and also on Laravel 11), the custom commands are registered and run just fine.
Some things I’ve already checked and tried:
The command class is in the correct namespace and includes a valid signature.
I can call the command manually, and it executes as expected.
I’ve run all the usual cleanup commands like clearing caches and regenerating autoload files.
Docker containers have been rebuilt from scratch.
I even tested by setting full permissions on the command files.
I attempted explicit registration using Laravel's withCommands() method during bootstrapping.
Given that everything works outside Docker, I suspect the issue is somehow related to the Docker setup, though I haven’t found any solid leads or documentation confirming this.
If needed, I’m happy to share my Docker setup details — just wanted to keep this post focused.
Any ideas or insights would be greatly appreciated. Thanks!
Please or to participate in this conversation.