@ Cem, Welcome to Microsoft Q&A! Thanks for posting a good question!
I understand the scenario you’re dealing with in-built image, but am afraid, as mentioned in this document “Any changes you make outside the /home directory are stored in the container itself and don't persist beyond an app restart.”
{Just to highlight} However, on Custom container, you can use an app setting called WEBSITES_ENABLE_APP_SERVICE_STORAGE to control whether or not the /home directory of your app is mapped to Azure Storage. If you need files to be persisted in scale operations or across restarts, you should add this app setting and set it to "true". If you don't require file persistence, you can set this app setting to false.
Furthermore, to use the custom startup script, go to the portal “Application Settings” page and override the StartupFile to /home/site/wwwroot/startupScript.sh and then try calling /bin/init_container.sh based on your requirement.
Your feedback is highly appreciated, you may always share your feedback on Uservoice (https://feedback.azure.com/forums/169385-web-apps) - All of the feedback you share in these forums will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.