I am using Docker for Windows Community Edge edition. I am a newbie and I am trying to follow the Getting Started tutorial for Docker for Windows. I have installed it on Wndows 10 without apparent problems. One of the commands in the tutorial is
docker run -it ubuntu bash
which should start a Ubuntu instance running the bash shell. How do I interact with this copy of bash? I have been completely unable to find a way. Also I have been unable to find any documentation on the -it option to run.
My problem, at this point is conceptual. In a normal machine, you can access bash from a graphical terminal program such as Gnome-terminal, or from one of the low-level Linux consoles. Either way gives you an environment that allows you to interact directly with bash. My problem is to understand how to invoke bash in a container under Docker so that I can interact with it as if I was on a bare non-Docker machine.
Note that the Docker environment is very different from a full-blown Linux VM. If you’re looking for a graphical terminal to “interact with the machine”, a VM-based solution might be a better match. (It is difficult at best to run a graphical application from Docker.)
The thing Docker is really good at is packaging and running single-task network processes, especially things like Web-based microservices. Read up on the Dockerfile system. Plan to routinely delete your containers. It’s rare IME to use an interactive shell to work with a container unless I’m trying to debug it.
When I tried to run bash as you show, the run command never returned after 1 hr. waiting and I had to do Ctrl-C to get a prompt. The bash prompt was never displayed.