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?
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>
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
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.