1.docker attach介绍
docker attach命令是用来进入一个正在运行的docker容器
2.docker attach用法
docker attach [参数] container
[root@centos79 ~]# docker attach --help
Usage: docker attach [OPTIONS] CONTAINER
Attach local standard input, output, and error streams to a running container
Aliases:
docker container attach, docker attach
Options:
--detach-keys string Override the key sequence for detaching a container
--no-stdin Do not attach STDIN
--sig-proxy Proxy all received signals to the process (default true)
[root@centos79 ~]#
3.实例
3.1.进入启动的docker容器
命令:
docker attach 800d
[root@centos79 ~]# docker ps -a | grep 800d
800d0759315f centos:centos7 "/bin/bash" 20 hours ago Up 14 seconds