Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does Docker Quickstart Terminal do?

I just recently started using Docker. I'm able to run my servers, and communicate between them.

What I don't understand is: why do I need to run Docker commands, like $ docker run somerepo/image from the window opened by Docker Quickstart Terminal.

Running it from "regular" Terminal windows returns

$ docker run dockerinaction/hello_world
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?. See 'docker run --help'.

I understand that on OS X and Windows, Docker needs to start one virtual machine with Linux 2.6 (in my case), and that all containers are run within that VM.

I thought docker CLI was connecting to a docker deamon that runs inside that VM - and then I don't understand what happens in the Quickstart Terminal.

like image 812
Marian Kostko Avatar asked Jun 28 '16 18:06

Marian Kostko


People also ask

What does Docker CLI command do?

Docker CLI management commands start with docker , then a space, then the management category, then a space, and then the command. For example, docker container stop stops a container. A command referring to a specific container or image requires the name or id of that container or image.

What is the difference between Docker run and start command?

Docker start command will start any stopped container. If you used docker create command to create a container, you can start it with this command. Docker run command is a combination of create and start as it creates a new container and starts it immediately.

Does Docker automatically start?

Docker provides restart policies to control whether your containers start automatically when they exit, or when Docker restarts. Restart policies ensure that linked containers are started in the correct order. Docker recommends that you use restart policies, and avoid using process managers to start containers.


1 Answers

I don't understand what does happen in the Quickstart Terminal.

You can use a regular terminal, provided by docker-machine env, and do operations similar to osx/mpkg/quickstart.app/Contents/Resources/Scripts/start.sh:

dockerm-machine start dev
eval "$(docker-machine env dev)"

(replace 'dev' with the name of your docker machine. By default, it is named... "default")

Once those environment variables for the Docker client are set, you can execute docker command directly from your shell.
A Quickstart Terminal would set those same variable for you.

like image 197
VonC Avatar answered Oct 08 '22 05:10

VonC