Try to kill “docker run” by pressing ctrl+c. I expect that the “docker run” command will stop and I’ll get a running shell again
Actual behavior
“docker run” traps or ignores ctrl+c.
Information
the output of:
pinata diagnose -u on OSX
$ pinata diagnose -u
OS X: version 10.11.4 (build: 15E65)
Docker.app: version v1.11.1-beta12
Running diagnostic tests:
[OK] Moby booted
[OK] driver.amd64-linux
[OK] vmnetd
[OK] osxfs
[OK] db
[OK] slirp
[OK] menubar
[OK] environment
[OK] Docker
[OK] VT-x
Docker logs are being collected into /tmp/20160522-085701.tar.gz
Most specific failure is: No error was detected
Your unique id is: AFA59180-C76B-4ECF-BB20-13C96956D87D
Please quote this in all correspondence.
Can the tutorial be updated? The following is incorrect:
"
Run the app, mapping your machine’s port 4000 to the container’s published port 80 using -p:
docker run -p 4000:80 friendlyhello
…
Hit CTRL+C in your terminal to quit.
Now let’s run the app in the background, in detached mode:
docker run -d -p 4000:80 friendlyhello
"
Actual result: Ctrl+c detaches the friendlyhello process and returns control to the terminal. When you try to run the next “docker run…” command an error returns because there is already a process using the port 80.
Thanks a lot for this. Not only does this allow me to both ctrl-c and run commands while image is running, it also enables ASCII colors and formatting. Would you be able to tell me what exactly the --tty flag is doing here? I don’t have much exposure to tty, and the bit of research I’ve done hasn’t helped me understand what’s going on here in the context of Docker.