New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker tty is not a tty with docker exec #8755
Comments
|
what is |
|
TERM is already set to xterm. When I launch tmux -vvvv the tmux-client.log is empty but the tmux-server.log contains: |
|
When I try |
|
Ok, I managed to get something to work with I really think this is a bug because: But if I do |
|
i'm also running into this issue. docker@boot2docker:~$ docker --version
Docker version 1.3.0, build c78088fthe only solution i found was to use docker exec -ti container script /dev/null |
|
I was actually able to run |
|
Wow, that's great, do you know what changed? Are you able to reproduce this? |
|
Scratch that. Can't seem to reproduce. |
|
I'm experiencing weird behavior with environment variables, For example, when I run: docker exec -ti razic script /dev/null -c 'tmux'The container launches. But, then I run If I run the same command above, but pass the docker exec -ti razic script /dev/null -c 'tmux -c "vim .bash_profile"'I get colors correct: Seem like Basically I can only launch docker exec -ti razic script /dev/null -c 'bash -ilc tmux'or all manually: docker exec -ti razic script /dev/nullthen from inside the container: # colors are good without tmux
vim .bash_profile
# start tmux
tmux
# colors are not good in tmux
vim .bash_profile
# detach tmux
[detached]
# log in to bash
bash -il
# start tmux
tmux
# colors are good
vim .bash_profile |
|
can you all let me know if this is still a relevant issue. |
|
Yes, it's still relevant. Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8
Kernel Version: 3.13.0-36-generic
Operating System: Ubuntu 14.04.1 LTS |
|
I'm experiencing the same problem, docker |
|
So, what image are you running, and with what run command, and what exec command? |
|
@cpuguy83 I am running an image based on Here are the steps which can be used to reproduce the problem. # on the docker host
docker run -it --rm --name foo ubuntu:14.04 bash
# inside the container
apt-get update
apt-get install tmux
tmuxIn another terminal on the host: docker exec -it foo bash
# inside the container
tmux lsThe latter command will fail, and tmux will crash in the original terminal, in some cases killing the container altogether and/or turning it into a container-zombie (in which case one must |
|
It seems that any image which has bash in it has the problem. Step to reproduce: |
|
Any chance a fix for this bug will land in |
|
So what is the purpose of using |
|
We use docker with ansible as a developer workstation, with this we have a If you are interested, here is a quickstarter Le Thu Feb 05 2015 at 5:27:03 PM, Brian Goff notifications@github.com a
|
|
@cpuguy83 when working in "dev mode" with my containers, I generally pass In other words, if this is a bug, it seems like it should be fixed. If it can't be fixed at present, or if it's a foreseen and/or intended limitation of |
|
i also use docker for my development environment. this is why i run tmux On Thu, Feb 5, 2015 at 1:04 PM, Michael Bradley notifications@github.com
|
|
@michaelsbradleyjr +1 on Michael's comments. The connection to the host often drops. The image itself is designed to run monit(proc monitor), not bash, and I connect to it by way of Then I would like to If somebody has a better suggestion how to accomplish this, I appreciate your comments. |
|
+1! |
|
@razic this stuff is so advanced that I can't follow a word of what you've just said, but sounds promising. I'm eagerly waiting for this. Thanks for working on it. |
|
Quick update... I was able to get a container running via |
|
Fixed by #33007 |
|
And there was much rejoicing. |
|
awesome!!!! please gentleman, in what docker version can I grab this fix? |
|
This will be in 17.06 |
|
Will this land in an edge release before that? Was it landed in 17.05.0-ce-mac11? Any pointers on where to check this? :) |
|
No, this won't be in 17.05, only 17.06 and upward |
|
Okay, thank you! Is there a release date set? Sorry for asking so many questions :) tried googling first but didn't find it, maybe I just a missed it though... |
|
The version is YY.MM, and we target first week of the month, so first week of June, with release candidates before that |
|
Ah, that's great to know, thank you! |
|
Great news @thaJeztah ! |
|
Hi @thaJeztah, is 17.06 going to land in in june or will it be rescheduled for july? if so, will it be 17.07 instead? just wan't to be sure regarding the version that will have this fix landed. |
zacharys-pro:dev razic$ docker run --rm -t -d ubuntu bash
83c292c8e2d13d1b1a8b34680f3fb95c2b2b3fef71d4ce2b6e12c954ae50965a
zacharys-pro:dev razic$ Docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
83c292c8e2d1 ubuntu "bash" 2 seconds ago Up 1 second xenodochial_bardeen
zacharys-pro:dev razic$ docker exec -ti xenodochial_bardeen tty
/dev/pts/1
zacharys-pro:dev razic$ docker version
Client:
Version: 17.06.0-ce
API version: 1.30
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:31:53 2017
OS/Arch: darwin/amd64
Server:
Version: 17.06.0-ce
API version: 1.30 (minimum version 1.12)
Go version: go1.8.3
Git commit: 02c1d87
Built: Fri Jun 23 21:51:55 2017
OS/Arch: linux/amd64
Experimental: trueGreat work everyone. Thank you very much. |
|
is this released? where? |
|
@ninrod I've included the version information in the output. This is fixed in version |
|
Oh. but this is not ready yet for docker for windows, right? |
|
just tested it on Docker-for-Mac latest and it works. I'm a happy man :-) |
`tty` might or might not work depending on whether a Docker container or a Kubernetes pod is run with `-t` / `tty: true`. Moreover, it depends on the flags passed initially to `run` and also to flags passed later to `exec` when attaching a shell to an already running container. See moby/moby#8755 for details. It's more convenient to just generate a random ID like relx does in scripts it generates for releases.
`tty` might or might not work depending on whether a Docker container or a Kubernetes pod is run with `-t` / `tty: true`. Moreover, it depends on the flags passed initially to `run` and also to flags passed later to `exec` when attaching a shell to an already running container. See moby/moby#8755 for details. It's more convenient to just generate a random ID like relx does in scripts it generates for releases.


When I enter a running docker with "docker exec -ti mydockerinstance /bin/bash"
tty returns: not a tty and tmux doesn't work.
I tried several things from #728:
docker exec -ti mydockerinstance sh -c "exec >/dev/tty 2>/dev/tty </dev/tty && /usr/bin/tmux -s /bin/bash"getty ttybut nothing succeded.
The text was updated successfully, but these errors were encountered: