Mounting Multiple Sockets on Docker Container, making it use the second socket for spinning up containers.
My app takes socket as a volume mount in the docker container and then spins up more containers. The problem is, I don’t want it to use the same socket when spinning up the containers. I want my application to reside in the first socket and for all other containers, it would be spinning up using other socket.
I created two docker sockets, pids, and /var/lib/docker2. After that, I mounted the second socket inside my container and ran the “docker run” command while using the first socket. But, eventually, my app containers were showing in the second daemon while using the second socket. I didn’t want that.
I wanted my app containers to be using the first socket to run themselves and use the other/second socket to spin other containers.
Ahson Shaikh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.