What
As mentioned in this discourse post, when running composer can fail quietly. This means that although it wasn't able to complete its processing successfully, the next steps from the Dockerfile are still processed and therefore leads to a /var/www/html/vendor not found error ( since running composer failed, the vendor folder did not get generated! )
Current Workaround
Please pass BUILDKIT_PROGRESS=plain so that the logs from the composer failure be visible.
Outlook
Properly clean the declaration of the composer commands so that it can noisily fail, and share the error with the users on why it failed, AND, completely stop the docker build process if possible