Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Docker by (55.6k points)

Can anyone tell me which docker command lets us attach to a running container?

1 Answer

0 votes
by (119k points)

You can use docker command “docker attach” to attach your terminal’s standard input, output, and error to a running container by using either container’s ID or name.

This docker command helps you to see its currently running output or to control it interactively.

Here is an example of using docker attach to a running container:

$ docker run -d --name topdemo ubuntu /usr/bin/top -b

$ docker attach topdemo

I recommend this Docker Training Course by Intellipaat to learn Docker.

Also, you can watch this Docker commands tutorial:

Related questions

0 votes
1 answer
asked Mar 7, 2020 in Docker by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Nov 2, 2020 in Docker by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Nov 2, 2020 in Docker by Sudhir_1997 (55.6k points)

Browse Categories

...