docker错误
错误:cannot enable tty mode on non tty input
错误产生:
root@machine1:/data# echo test|docker exec -i 68b cat test root@machine1:/data# echo test|docker exec -it 68b cat cannot enable tty mode on non tty input
问题在于,当使用-it时,容器为我们分配了伪终端,等待我们从终端输入数据到伪终端的标准输入。但我们的输入方式却不是从终端,有可能是重定向和管道。官网对于it参数的解释:
-t
and -i
.The
-t
flagassigns a pseudo-tty or terminal inside our new container and the
-i
flagallows us to make an interactive connection by grabbing the standard in (
STDIN
)of the container.
In foreground mode (the default when -d
is not specified), docker
can start the process in the container and attach the console to the process’s standard input, output, and standard error. It can even pretend to be a TTY (this is what most command line executables expect) and pass along signals. All of that is
run
configurable:
-a=[] : Attach to `STDIN`, `STDOUT` and/or `STDERR`
-t=false : Allocate a pseudo-tty
--sig-proxy=true: Proxify all received signal to the process (non-TTY mode only)
-i=false : Keep STDIN open even if not attached
If you do not specify -a
then Docker will attach
all standard streams. You can specify to which of the three standard streams (STDIN
, STDOUT
, STDERR
)
you’d like to connect instead, as in:
$ docker run -a stdin -a stdout -i -t ubuntu /bin/bash
For interactive processes (like a shell), you must use -i -t
together
in order to allocate a tty for the container process. -i -t
is
often written -it
as you’ll see in later examples. Specifying -t
is
forbidden when the client standard output is redirected or piped, such as in: echo
.
test | docker run -i busybox cat
解决方法:某些情况下it不能同时使用
docker错误的更多相关文章
- docker 错误:Error response from daemon: cannot stop container: connect: connection refused": unknown
docker 错误:Error response from daemon: cannot stop container: 795e4102b2de: Cannot kill container 795 ...
- docker 错误排查:无法进入容器.
docker 错误排查:无法进入容器. #docker exec -it 3c1d bash rpc error: code = 2 desc = oci runtime error: exec fa ...
- 如何处理Docker错误消息:please add——insecure-registry
本地安装Kubernetes时,遇到如下的错误消息: pleade add --insecure-registry gcr.io to daemon's arguments 解决方案:点击Docker ...
- Docker 错误:network xxx id xxxx has active endpoints
问题描述:Docker Compose 部署的项目,使用docker-compose down 命令关闭时,提示错误: Removing network xxxl_default ERROR: net ...
- docker 错误
docker search ubuntuGet http:///var/run/docker.sock/v1.20/images/search?term=ubuntu: dial unix /var/ ...
- Docker 错误 docker: invalid reference format. 的解决
运行 docker run –it –v /dataset:/dataset –v /inference:/inference –v /result:/result floydhub/pytorch: ...
- docker 错误failed to open stream: Permission denied 解决方法
在服务器上面.运行docker时,php目录会发生权限问题解决方法如下: 1:进入php目录下面 docker exec -ti php56 /bin/bash #进入php容器 chown -R w ...
- Docker实战(4):Docker错误记一笔
创建容器的时候报错WARNING: IPv4 forwarding is disabled. Networking will not work. 解决办法: vim /usr/lib/sysctl.d ...
- docker错误处理——docker Job for docker.service failed because the control process exited with error code.
(15条消息) docker Job for docker.service failed because the control process exited with error code._Hel ...
随机推荐
- 内联样式自动出现,一般是js控制写入的
内联样式自动出现,一般是js控制写入的
- Android 中Fragment使用
Android 中Fragment使用 public class MainActivity extends Activity { public static String[] array = { &q ...
- OData services入门----使用ASP.NET Web API描述
http://www.cnblogs.com/muyoushui/archive/2013/01/27/2878844.html ODate 是一种应用层协议,设计它的目的在于提供一组通过HTTP的交 ...
- Spring实战2:装配bean—依赖注入的本质
主要内容 Spring的配置方法概览 自动装配bean 基于Java配置文件装配bean 控制bean的创建和销毁 任何一个成功的应用都是由多个为了实现某个业务目标而相互协作的组件构成的,这些组件必须 ...
- bzoj4561: [JLoi2016]圆的异或并
Description 在平面直角坐标系中给定N个圆.已知这些圆两两没有交点,即两圆的关系只存在相离和包含.求这些圆的异或面 积并.异或面积并为:当一片区域在奇数个圆内则计算其面积,当一片区域在偶数个 ...
- SVN 主干(trunk)、分支(branch )、标记(tag)
主干(trunk).分支(branch ).标记(tag) 在SVN中Branch/tag在一个功能选项中,在使用中也往往产生混淆. 在实现上,branch和tag,对于svn都是使用copy实现的, ...
- sbt设置
配置中央仓库 vim ~/.sbt/repositories [repositories] local osc: http://maven.oschina.net/content/groups/pub ...
- C#学习笔记五: C#3.0Lambda表达式及Linq解析
最早使用到Lambda表达式是因为一个需求:如果一个数组是:int[] s = new int[]{1,3,5,9,14,16,22};例如只想要这个数组中小于15的元素然后重新组装成一个数组或者直接 ...
- android的m、mm、mmm编译命令
android的m.mm.mmm编译命令的使用 android源码目录下的build/envsetup.sh文件,描述编译的命令 - m: Makes from the top of th ...
- linux下安装mysql数据库与相关操作
如下命令都是用root身份安装,或者在命令前加上sudo 采用yum安装方式安装 yum install mysql #安装mysql客户端 yum install mysql-server #安装m ...