More than 5 years have passed since last update.


Posted at

いざ、Dockerを使おうとdocker pull centosをしても

$ docker pull centos
Using default tag: latest
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?). Using system default: https://index.docker.io/v1/
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
butada-mac:python_camera butada$ docker run hello-world
docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?.
See 'docker run --help'.



  • Mac OS X El Capitan
  • Docker version 1.10.1, build 9e83765


用途 コマンド
Docker用のVMを作成 docker-machine create --driver virtualbox default
環境変数を設定 eval $(docker-machine env default)
VM一覧を表示 docker-machine ls
Hello worldコンテナを実行 docker run hello-world
Docker用VMを再起動 docker-machine restart default



$ docker-machine create --driver virtualbox default2
Running pre-create checks...
Creating machine...
(default2) Copying /Users/butada/.docker/machine/cache/boot2docker.iso to /Users/butada/.docker/machine/machines/default2/boot2docker.iso...
(default2) Creating VirtualBox VM...
(default2) Creating SSH key...
(default2) Starting the VM...
(default2) Check network to re-create if needed...
(default2) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Docker is up and running!
To see how to connect your Docker Client to the Docker Engine running on this virtual machine, run: docker-machine env default2


# eval $(docker-machine env default2)


$ docker-machine env default2
export DOCKER_HOST="tcp://"
export DOCKER_CERT_PATH="/Users/butada/.docker/machine/machines/default2"
export DOCKER_MACHINE_NAME="default2"
# Run this command to configure your shell: 


$ docker-machine ls
NAME       ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER    ERRORS
default2   -        virtualbox   Running   tcp://           v1.10.3   

Hello Worldを動作させ、コンテナが動作することを確認する。

$ docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
03f4658f8b78: Pull complete 
a3ed95caeb02: Pull complete 
Digest: sha256:8be990ef2aeb16dbcb9271ddfe2610fa6658d13f6dfb8bc72074cc1ca36966a7
Status: Downloaded newer image for hello-world:latest

Hello from Docker.
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker Hub account:

For more examples and ideas, visit:

あとは、docker pull centosなどを実行できます。


Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up