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 on exit when container is run with -i -d #1869

Closed
mkscrg opened this issue Sep 12, 2013 · 5 comments
Closed

docker attach hangs on exit when container is run with -i -d #1869

mkscrg opened this issue Sep 12, 2013 · 5 comments

Comments

@mkscrg
Copy link

mkscrg commented Sep 12, 2013

This prints Hello and World to the console:

sudo docker run ubuntu /bin/bash -c 'sleep 1; echo Hello'; echo World

This hangs after the container exits, only printing Hello:

cid=$(sudo docker run -i -d ubuntu /bin/bash -c 'sleep 1; echo Hello'); sudo docker attach $cid; echo World

Any additional key presses cause it to exit and print World, but this is troublesome for scripts.

@ghost ghost assigned creack Sep 16, 2013
@pwaller
Copy link
Contributor

pwaller commented Sep 21, 2013

Could this be related to #1300? What operating system is the host? Can you show the output of running the docker daemon with debug output turned on?

@vieux
Copy link
Contributor

vieux commented Sep 23, 2013

I think this is fixed on master, can you confirm ?

On Sat, Sep 21, 2013 at 10:28 AM, Peter Waller notifications@github.comwrote:

Could this be related to #1300#1300?
What operating system is the host? Can you show the output of running the
docker daemon with debug output turned on?


Reply to this email directly or view it on GitHubhttps://github.com//issues/1869#issuecomment-24858496
.

Victor VIEUX
http://vvieux.com

@creack
Copy link
Contributor

creack commented Sep 23, 2013

No, it is not fixed. It is a different issue than hang after escape sequence.

@creack creack closed this as completed Nov 5, 2013
mmalecki added a commit to mmalecki/dokku that referenced this issue Nov 13, 2013
ghost pushed a commit to dokku/dokku that referenced this issue Nov 13, 2013
mincedmit pushed a commit to ginlane/dokku that referenced this issue Feb 13, 2014
mincedmit pushed a commit to ginlane/dokku that referenced this issue Feb 13, 2014
@anentropic
Copy link

This is occurring for me still/again with 0.8.x (symptom exactly as per OP above)

I'm on OSX with latest boot2docker

@colin-riddell
Copy link

I think I may be experiencing this issue with docker version 1.2 when trying to do:

 sudo docker attach e728d7b26857

uname -a for host:

    Linux android-host-2 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Container based on official Ubuntu 12.04.

Command used to run container:

sudo docker run -u=root -v /home/full_tests:/home/full_tests  -e PATH=$PATH:/android-sdk-linux/platform-tools -i -d --privileged --device /dev/bus/usb/001/001 10d7ec2cfa4d /home/myuser/myscript.sh

Ctrl+C doesn't do anything, and attach command just sits there:

myuser@android-host-2:~$ sudo docker attach e728d7b26857

^C

I am happy to be told that I am doing something wrong. The documents for attach don't mention anything about which kind of startup processes you can/cannot attach to. However in the examples I have seen it's /bin/bash or like in the docs it's /usr/bin/top

http://docs.docker.com/reference/commandline/cli/#attach

(I realise this is issue is closed, does that mean nobody will look at it?)
I am happy to provide more information and help debug if necessary..

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

No branches or pull requests

6 participants