There shoud be a better error message when you scroll up in the terminal. The one you quoted is the end, which just shows a process exited, but in the log that shows the output of the commands should be the usual error message returned by that command.
In case you don’t find that log for any reason, yo can run a shell from the base image and execute the commands manually.
The base image is a bullseye version of debian, but Debian Bullseye reacheed its end of life at the end of August. So no security patches will be provided and the repository that contained the security patches was likely removed. I suspect that you got “404 Not Found” error message in the logs i referred to.
So the solution would be using a newer Debian version which is still supported.
If you really need to test the image build with an outdated Debian before upgrading, you will need to copy a new Debian APT repo list config file which has no reference to the security repo. It would be a COPY instruction if you have a file locally. Or you can use “sed” to remove the line from the existing file in the image.
The permanent solution would still be using a newer debian image.