I have 2 docker containers running (A and B).
Have a need to call from within container A -> a bash command inside container B.
How to achieve this?
I have 2 docker containers running (A and B).
Have a need to call from within container A -> a bash command inside container B.
How to achieve this?
If your B container looks something like this:
docker run -d --name b_container --rm ubuntu:latest sleep 50000
and your A container looks something like this:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu:latest sh -c "apt-get update ; apt-get install docker.io -y ; bash"
you can do (while you're bashed into A):
Ps. i don't suggest you do this, you wanted a way... there you are