My assumption was that when you use
docker run and image is taken and turned into a running container. That container is running on a virtual machine that was created by
docker-machine create. However I can create containers using
docker run without having ever created a docker machine.
I am asking because I am trying to follow a tutorial where the presenter runs a process that is accepting information on a port. He executes:
docker run --rm -ti -p 45678:45678 -p 45679:45679 --name echo-server ubuntu:14.04 bash
then inside the container:
nc -lp 45678 | nc -lp 45679
Then in a different terminal he uses
docker-machine ip and recieves and ip address (later on he creates another container to relay the output to, but i didn’t get that far). However I just get “Error: No machine name(s) specified and no “default” machine exists”.
I see that I can create a machine using virtualbox or whatever other software, but how is that related to the container I just created? How am I running this container with no machine? Is there a hidden machine that I am running it on or are there multiple ways to run containers? If there is no machine, how do I get the IP address of the container?
Thanks, just getting started with this stuff, hope this is the right area to ask this question.