Execute host shell script from meteor container

I have shell script on my host. I’ve installed docker container with meteord image. I have it running, however I would like to execute this shell script inside meteord docker image. Is that possible?

  • After installing Docker, docker-machine env default fails because ca.pem is not found
  • How do I run the same docker-compose.yml several times on same docker daemon with different names?
  • What's the point of data-only docker containers?
  • Installation of chef-client(Bootstrapping) on docker container in a VM on Azure/AWS
  • how to permanently set environment variable for boot2docker
  • How can I start Nginx with php-fpm based on Ubuntu image using Dockerfile?
  • How Docker is better than Vagrant+LXC+Chef [closed]
  • Running docker using linux kernel 4.3.0 got iptables nat error
  • Is it possible to change the read-only/read-write status of a docker mount at runtime?
  • How to move Docker data folder on macOS Sierra
  • How do I modify a startup script in a docker container when it is stopped?
  • Change the owner of a file in a running Docker container with an attached volume in Windows
  • One Solution collect form web for “Execute host shell script from meteor container”

    Yes. That is possible but you will have to copy the script in the container as follow:

    docker cp <script> <container-name/id>:<path>
    docker exec <container-name/id> <path>/<script>

    For example:

    docker cp script.sh silly_nightingale:/root
    docker exec silly_nightingale /root/script.sh

    Just make sure the script has executable permissions. Also, you can copy the script at build time in Dockerfile and run it using exec afterwards.


    You can also try docker volume for it as follow:

    docker run -d -v  /absolute/path/to/script/dir:/path/in/container <IMAGE>

    Now run the script as follow:

    docker exec -it <Container-name>  bash /path/in/container/script.sh

    Afterwards you will be able to see the generated files in /absolute/path/to/script/dir on host. Also, make sure to use absolute paths in scripts and commands to avoid redirection issues. I hope it helps.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.