The previous blog entry showed you how you can run bash in a reproducible way. But what if you want your bash script to spawn docker containers? Well then you will need to use another image.
A very simple recipe is illustrated below.
#!/bin/bash docker run -i manorrock/bash:4.3.42 /bin/bash -c 'echo boo'
docker run -v $PWD:/mnt -v /var/run/docker.sock:/var/run/docker.sock -i manorrock/bash:4.3.42-docker-1.12.6 /bin/bash myscript.sh
And voila! The bash script spawns another docker container.
Posted April 10, 2017