I want to execute some code inside a docker container. To do this, I execute this script:
#!/bin/bash
docker start mycontainer
docker exec mycontainer python hello.py
docker exec mycontainer cd modifiedDiffusion
docker exec mycontainer python hello.py
docker exec mycontainer sh executeModifiedDiffusion.sh
docker stop mycontainer
I created a simple print('hello world')
type script in the first directory in which the container puts you and a second script in the directory modifiedDiffusion.
The command cd modifiedDiffusion
works, because I tried some tests with the ls
command.
The first script runs, but the problem is that the second python script doesn't run. How do I solve this?