Docker Exec command does not work properly
I have a script (run.sh) that I run as I initialize the container through “docker run” command. The script runs successfully. I can also get a bash instance (through “docker exec -i -t container-name bash”) in the container and run the script successfully (note that by default I have su privileges when I get the bash). However, when I run the script from the host through “docker exec -i -t container-name /run.sh” the script runs but does not provide the outcome that it provides through the alternative approaches. I know it runs as it produces some of the expected behavior but not all of them. So my main question is what are the difference between executing a script through commandline and running the same script through docker exec.
Appreciate any help on this.