Intellipaat 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:

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...