Docker attach: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 5: Line 5:
=Overview=
=Overview=


Attachs local standard input, output, and error streams to a running container. The container to attach to should be started in [[Docker_run#-i.2C_--interactive|interactive mode]], giving the ability to type into it, and with a [[Docker_run#-t.2C_--tty|TTY]] so you can see the input and output:
Attach local standard input, output, and error streams to a running container. The container to attach to should be started in [[Docker_run#-i.2C_--interactive|interactive mode]], giving the ability to type into it, and with a [[Docker_run#-t.2C_--tty|TTY]] so you can see the input and output:


  docker run -dit alpine1 alpine ash
  docker run -dit alpine1 alpine ash

Revision as of 03:46, 1 May 2018

Internal

Overview

Attach local standard input, output, and error streams to a running container. The container to attach to should be started in interactive mode, giving the ability to type into it, and with a TTY so you can see the input and output:

docker run -dit alpine1 alpine ash

Then, the attachment can be performed later:

docker attach alpine1