Hello,
Consider this scenario, in which I have two containers:
Redis container: A container that runs an image straight from Docker Hub. It doesn’t have to be Redis, the point is that I didn’t change anything about it. It can also be ElasticSearch, for example.
“Redis Manager” container: A container that runs my code, responsible for reacting to events in the system by changing the Redis configuration and restarting it.
Questions:
Is this a good practice in terms of how to manage containers configuration? I don’t want the host to manage configurations.
Can a container see another container’s processes and send them signals? For instance, killing a process or running a command on the other container.
To manage containers, generally you’ll need to be able to communicate with the docker daemon. One way to do this is to share in the /var/run/docker.sock socket:
docker run -v /var/run/docker.sock:/var/run/docker.sock ...
Once you can communicate with the docker daemon, you can pretty much do anything you can do with docker, including dealing with other containers.