Skip to content
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 attach hangs setting terminal state when attaching to container #10094

Closed
acbodine opened this issue Jan 14, 2015 · 11 comments
Closed

docker attach hangs setting terminal state when attaching to container #10094

acbodine opened this issue Jan 14, 2015 · 11 comments

Comments

@acbodine
Copy link
Contributor

Let's say I have a container such that:

docker@boot2docker:~$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
3a73e17af236        ubuntu:14.04        "/bin/bash"         2 seconds ago       Up 1 seconds                            modest_mcclintock

Then I attach to it:

docker@boot2docker:~$ docker attach modest_mcclintock

I press any key and I see:

docker@boot2docker:~$ docker attach modest_mcclintock
root@3a73e17af236:/# 
root@3a73e17af236:/# 

Shouldn't the first root@3a73e17af236:/# prompt be displayed when docker attach is run?

I can verify this isn't a boot2docker problem as I have seen similar behavior on Ubuntu 14.04

docker@boot2docker:~$ uname -a
Linux boot2docker 3.16.7-tinycore64 #1 SMP Tue Dec 16 23:03:39 UTC 2014 x86_64 GNU/Linux
docker@boot2docker:~$ docker version
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
docker@boot2docker:~$ docker -D info
Containers: 1
Images: 53
Storage Driver: aufs
 Root Dir: /mnt/sda1/var/lib/docker/aufs
 Dirs: 55
Execution Driver: native-0.2
Kernel Version: 3.16.7-tinycore64
Operating System: Boot2Docker 1.4.1 (TCL 5.4); master : 86f7ec8 - Tue Dec 16 23:11:29 UTC 2014
CPUs: 8
Total Memory: 1.961 GiB
Name: boot2docker
ID: CMKY:4CQL:L2XD:XDLJ:NFT3:R6HT:FVDW:JIJG:QFUO:IIQO:JK6I:7SAR
Debug mode (server): true
Debug mode (client): true
Fds: 11
Goroutines: 11
EventsListeners: 0
Init Path: /usr/local/bin/docker
Docker Root Dir: /mnt/sda1/var/lib/docker
@acbodine
Copy link
Contributor Author

I'm happy to submit a PR for this fix as well as it follows the workflow I looked into for #9860, if it is determined to be an issue.

@jessfraz
Copy link
Contributor

can you try on master? you can download binaries from master.dockerproject.com

@acbodine
Copy link
Contributor Author

From the tip of master 7d80fd6ca6f26f37b5c19d95b53c7fb4faa22bd1 I'm seeing the same behavior

@jessfraz
Copy link
Contributor

why are you attaching to bash? I think that is intentional behavior if you want to execute more things inside the container use docker exec

@jessfraz
Copy link
Contributor

attach seems to be working fine for me on master with irssi and mutt

@acbodine
Copy link
Contributor Author

ha - so this example was/is something I have been using to test other issues with being a long running process that won't die on me. Aside from that, you are right, it's not very practical. I noticed this behavior and wasn't sure if it was correct or not. It seems like when attaching the container's stdout isn't flushed to the cli until the cli provides data on the container's stdin in this case.

@jessfraz
Copy link
Contributor

so wdyt is this still an issue, sorry im confused :)

@jessfraz jessfraz reopened this Feb 27, 2015
@jessfraz
Copy link
Contributor

sorry and hit wrong button

@jessfraz
Copy link
Contributor

jessfraz commented Mar 2, 2015

ping @acbodine

@acbodine
Copy link
Contributor Author

acbodine commented Mar 2, 2015

I meant to close this. Whoops.

@acbodine acbodine closed this as completed Mar 2, 2015
@jessfraz
Copy link
Contributor

jessfraz commented Mar 2, 2015

ah cool thanks!

On Mon, Mar 2, 2015 at 11:05 AM, Andrew C. Bodine notifications@github.com
wrote:

I meant to close this. Whoops.


Reply to this email directly or view it on GitHub
#10094 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants