I want to write a shell script that enters into a running docker container, edits a specific file and then exits it.
My initial attempt was this -
- Create run.sh file.
Paste the following commands into it
docker exec -it container1 bash sed -i -e 's/false/true/g' /opt/data_dir/gs.xml exitRun the script -
bash ./run.sh
However, once the script enters into the container1 it lands to the bash terminal of it. Seems like the whole script breaks as soon as I enter into the container, leaving parent container behind which contains the script.