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.

  • Solr running inside docker container is not connecting to PostgreSQL database
  • Docker registry on EC2
  • cannot ADD file in current directory or in the directory with full path
  • MySQL import hangs on Vagrant CoreOS box on Mac
  • Docker link container - environment variables not being displayed
  • Why does docker compose exit right after starting?
  • Elasticsearch 5.0.1 java permission issue
  • How can I setup Docker container with individual IP address on EC2 instance?
  • Clone an image from a docker registry to another
  • Deploying Java webapp to Tomcat 8 running in Docker container
  • Load kernel module from mac os sierra host to a docker container
  • UDP Invalid Argument on Docker Swarm EC2
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.