You can’t use developer mode in docker production images. Production images do not have bench installed, you can’t do development in those images.
Why no bench in prod? If bench+frappe+erpnext is installed the image size will reach 3+ GB.
There is bench image for frappe, erpnext, bench and custom app development frappe_docker/development at main · frappe/frappe_docker · GitHub
I’ve added this issue long back as “help wanted” for other scenarios Help wanted for making docker easy to run · Issue #353 · frappe/frappe_docker · GitHub.