M
M
miteigi nemoto2020-02-26 09:32:36
Docker
miteigi nemoto, 2020-02-26 09:32:36

How to call a command line command from one container in another container?

It is necessary to call a command line command from one container in another container.
It's just that in the system the command is run as:
docker exec -it <container name> gosu command
but how to call the same command inside another container?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly Karasik, 2020-02-26
@vitaly_il1

I agree with the commentator that this is an ugly idea.
But if you really need it, you can forward the socket from the host:
https://stackoverflow.com/questions/39468841/is-it...
docker run -v /var/run/docker.sock:/var/run/docker.sock --name containerB myimage ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question