A
A
Alexander Nazarov2017-10-13 11:02:35
Docker
Alexander Nazarov, 2017-10-13 11:02:35

How to pass a command to the application worker process in Docker?

I create a container with flags: docker run -d -it --name Game
A java application - a game - is launched in the container.
Can you please tell me how to send commands to it?
It used to work with "Screen". At any time I connected ( screen –x) through the terminal to the working session "Screen" and could enter console, game commands, but in the case of Docker I can't figure out how to do this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gennadiy Balachkov, 2017-10-13
@wergio

docker exec -ti my_container sh -c "echo a && echo b"
Read more here https://docs.docker.com/engine/reference/commandli...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question