Docker attach: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
Attaches the invoking shell's stdin, stdout and stderr to the container specified as argument. | Attaches the invoking shell's stdin, stdout and stderr to the container specified as argument. | ||
The attachment will succeed only if the target container was started in [[Docker_Concepts#Interactive_Mode|interactive mode]]: | |||
docker run [-d] -i alpine1 alpine ash | docker run [-d] -i alpine1 alpine ash | ||
Then, the attachment can be performed | Then, the attachment can be performed with: | ||
docker attach alpine1 | docker attach alpine1 |
Revision as of 07:40, 3 May 2018
Internal
Overview
Attaches the invoking shell's stdin, stdout and stderr to the container specified as argument.
The attachment will succeed only if the target container was started in interactive mode:
docker run [-d] -i alpine1 alpine ash
Then, the attachment can be performed with:
docker attach alpine1