Matt Kildea
Matt Kildea

Reputation: 1

How can I start a docker container via an independent docker container?

I have a manager container that I would like to give the ability to start an adjudicator container N times. The adjudicator container does not persist so when it runs, it completes its tasks and then exits. How can I give the manager the ability to start this process over for a set amount of times?

I've seen people talk similar issues with a solution involving mounting docker socket or docker in docker but I'm fairly new to docker so I don't entirely understand what those entail.

Upvotes: -1

Views: 55

Answers (1)

Muhammad Nauman
Muhammad Nauman

Reputation: 1

You have to check "Docker-outside-of-docker" (DooD) to allow the manager container to control the docker environment.

Try following thing.

1- Mount the docker socket(/var/run/docker.sock) from the host when you run the manager container and the Command is

docker run -v /var/run/docker.sock:/var/run/docker.sock --name manager-container your-manager-image

*Just make sure Docker CLI is installed in your manager container.

You can also check Docker-in-Docker (DinD)

Upvotes: 0

Related Questions