Execute command from a container to another container?

Not really. The usual way for one container to cause another container to do something is with a network request, typically HTTP.

(You can, by publishing the Docker socket into the launching container, but that gives the container unrestricted root-level access over the entire host system, which isn’t something you should do lightly.)

2 Likes