Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialJohn Langan
3,921 PointsPassing the -i flag to docker fails
In the Docker Networking video at around 5:30 minutes the following command is used so we can attach to a shell within the containers. sudo docker -it --detach --name=container1 ubuntu
On my machine running Ubuntu 16.04 this results in this message. unknown shorthand flag: 'i' in -it See 'docker --help'. Usage: docker COMMAND
Any help in getting solving this would be appreciated.
1 Answer
Tom Geraghty
24,174 PointsDid you follow the install instructions here: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/
From: https://docs.docker.com/engine/reference/run/#foreground
-a=[] : Attach to `STDIN`, `STDOUT` and/or `STDERR`
-t : Allocate a pseudo-tty
--sig-proxy=true: Proxy all received signals to the process (non-TTY mode only)
-i : Keep STDIN open even if not attached
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.
Is there more error you can include? Were you able to get it to run any other commands successfully?
John Langan
3,921 PointsJohn Langan
3,921 PointsHi Tom, Sorry about the delay in replying. Yes I followed the instructions and I had got the hello-world test to run OK. Since then I've updated to Ubuntu 17.10 and the community edition refuses to install.
I don't need docker right now so I'll wait for a couple of iterations and then try again.
Thanks for your time and answer.
John.