20-Docker-常用命令详解-docker attach


前言

  • 本篇来学习docker attach命令

docker attach

  • 作用:进入容器正在执行的终端
语法格式
docker attach [OPTIONS] CONTAINER
options 说明
option说明
–detach-keys指定退出attach模式的快捷键序列,默认是 CTRL-p
–no-stdin是否挂你标准输入,默认是打开
–sig-proxy是否代理收到的系统信号给应用进程,默认为true

使用示例

进入容器
docker run -d --name topdemo centos /usr/bin/top -b
docker attach topdemo

在这里插入图片描述

和docker exec 的区别
  • #进入当前容器后开启一个新的终端,可以在里面操作。(常用)
    docker exec
  • #进入容器正在执行某个命令的终端,不能在里面操作;多个窗口同时attach到同一个容器时,所有窗口同步显示;当某个窗口因命令阻塞,其他窗口也无法操作
    docker attach
  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Troubleshooting Docker by Vaibhav Kohli English | 30 Mar. 2017 | ASIN: B013T7MQKM | 290 Pages | AZW3 | 11.47 MB Strategically design, troubleshoot, and automate Docker containers from development to deployment About This Book Utilize current and emergent technologies for effective Docker orchestration and management A step-by-step guide to diagnosing and fixing problems with Docker containers. Who This Book Is For This book is intended for seasoned solutions architects, developers, and programmers, system engineers, and administrators to help you troubleshoot common areas of Docker containerization. If you are looking to build production-ready Docker containers for automated deployment, you will be able to master and troubleshoot both the basic functions and the advanced features of Docker. Advanced familiarity with the Linux command line syntax, unit testing, the Docker Registry, Github, and leading container hosting platforms and Cloud Service Providers (CSP) are the prerequisites. What You Will Learn Install Docker ecosystem tools and services, Microservices and N-tier applications Create re-usable, portable containers with help of automation tools Network and inter-link containers Attach volumes securely to containers Consume and troubleshoot Docker APIs Troubleshooting issue of Docker deployment in Public cloud Ease the process of container management with Kubernetes In Detail This book will traverse some common best practices to for complex application scenarios where troubleshooting can be successfully employed to provide the repeatable processes and advantages that containers can deliver. This book will be a practical guide showing how to fix real-life issues related to installation, memory, Dockerfile syntax, connection, authorization, networking and so on in Docker. This book will also teach how to solve errors that occur during advanced setup and administration and deployment in a step-by-step fashion. By sequentially working through the real-world production scenarios in each chapter throughout the book, you will gain insight into and mastery of common areas not only for effective troubleshooting, but ways and means to avoid troubleshooting in the first place. This book will also cover tips and tricks that make the workflow easier. Style and approach An easy-to-follow guide full of interactive examples of real-world development and deployment scenarios. Ample screenshots, workflows, complementary tools, and related terminal commands are provided to address a wide range of practical and situational applications.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

爱学习de测试小白

你的鼓励将是我创作的最大动力!

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值