K
K
keltkelt2020-11-24 12:26:54
Docker
keltkelt, 2020-11-24 12:26:54

How to pass a command outside of a Docker container?

For example, I run locally docker run -it ubuntu /bin/sh

I type the docker command in the container terminal - it does not see it. A friend said you need to forward somehow.

Googled it, didn't understand anything. Did docker run -p 80:80 -it ubuntu /bin/sh, doesn't see it anyway.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-11-24
@trapwalker

Why are you trying to do this? Apparently you just do not understand what you want.
Docker is available in the host terminal. The container itself does not know anything about docker and should not know.
It is very strange to want to try to do something with the docker from the container terminal.
If you answer the question literally, then you can make an ssh connection to the host, but after that you are already in the host terminal via ssh, and not in the container terminal directly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question