I have a script that I want to run on existing images. For this I mount the script while running the container, commit changes and replace the image. The problem with binding the script at start is that the volume stays in new image too.In running an inspect on the image I can see it becomes a permannet argument and the run fails as the host system does not have the one time script.
Is there any way that the script runs, makes OS level changes and is removed completely. The script is fairly involved and calls a bunch of other scripts too.
command to run conatainer with script
docker run --name temp_container --ipc host -v /path_to_scripts_dir:/new_dir iamge bash -v /new_dir/call_scripts.sh'
New to docker, any pointers would help!