Docker Exec command does not work properly

I have a script ( 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 /” 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.

  • Docker compose: command after docker-compose run command
  • Docker - docker compose two branches - Updated
  • npm ERR! Linux 4.1.19-boot2docker
  • How to manage secrets in a Microservice / Container / Cloud environment?
  • Continuous Deployment Using Travis CI and Docker
  • How to run docker-compose on remote host?
  • Explanation of Docker Attach payload
  • datadog agent not reachable from inside docker container
  • Exposing spring boot random server port using docker
  • How to implement custom health checks for EC2 instances without using an ELB?
  • using IPython notebook with docker
  • Azure App Service + Docker Autodeploy?
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.