Error(111)  response from daemon: docker(170)で機械学習(101) 環境構築(1) 

# OS上のdocker コマンド
「docker どっかーら、どーやってもエラーばっかり」な時、
順番に動作を確認することが大事。

また、ここに記載した事項は、順次解決しています。
ここに追記するか、関連URLの先に記載し、ここに再整理予定です。

<この項は書きかけです。順次追記します。>
This article is not completed. I will add some words in order.

## dockerコマンドが導入済みか
「docker ps」で確認するとよい。

## docker ps

```
$ docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

```
上記はMacでDockerアプリを起動していなかった時。

```
$ docker ps
Error response from daemon: dial unix vms/0/00000003.00000948: connect: connection refused

$ docker ps
Error response from daemon: Bad response from Docker engine
```
上記はdocker アプリは起動している。接続がうまくいっていない。

```
OgawaKishinoMBP:~ ogawakiyoshi$ docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
```
上記はdocker psコマンドはうまく機能しているが、なにもdockerを起動していない時。

## docker images

```
$ docker images
REPOSITORY                                              TAG                 IMAGE ID            CREATED             SIZE
```
まだ、何もしていない時は上記。過去の残骸がある場合は、例えば下記。

```
$ docker images
REPOSITORY                                              TAG                 IMAGE ID            CREATED             SIZE
kaizenjapan/anaconda2-willi                             <none>              65e195f7ae66        47 hours ago        4.5GB
<none>                                                  <none>              cd3ce6c61c89        2 days ago          5.66GB
<none>                                                  <none>              23cc27429c4b        2 days ago          5.66GB
<none>                                                  <none>              05a7a823de44        2 weeks ago         2.9GB
ubuntu                                                  14.04               c32fae490809        4 weeks ago         188MB
continuumio/anaconda3                                   <none>              a9090db7be5a        4 months ago        3.6GB
gcc                                                     <none>              8357b3fcbe41        6 months ago        1.64GB
```
## docker rmi
もう使わないimageは消しておくとよい。

```
$ docker rmi  65e195f7ae66
Error response from daemon: conflict: unable to delete 65e195f7ae66 (cannot be forced) - image has dependent child images

$ docker rmi 05a3bd381fc2   
Error response from daemon: conflict: unable to delete 05a3bd381fc2 (must be forced) - image is being used by stopped container 0137e4ebe13d

$ docker rmi 0137e4ebe13d
Error: No such image: 0137e4ebe13d
```

## docker commit

```
$ docker commit 5e6115003e9f kaizenjapan/anaconda-nikhil 
Error response from daemon: Error processing tar file(exit status 1): write /opt/conda/lib/python3.6/site-packages/PyQt5/Qt/lib/libQt5WebEngineCore.so.5: no space left on device
```

## docker pull

```
docker pull kaizenjapan/anaconda-keras
Using default tag: latest
Error response from daemon: Get https://registry-1.docker.io/v2/kaizenjapan/anaconda-keras/manifests/latest: unauthorized: incorrect username or password
```

## docker login

```
$ docker login
Authenticating with existing credentials...
Stored credentials invalid or expired
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to https://hub.docker.com to create one.
Username (kaizen@wh.commufa.jp):      
Password: 
Error response from daemon: Get https://registry-1.docker.io/v2/: unauthorized: incorrect username or password
```

なぜか、Webでhub.docker.comにloginしたら入れた。
https://hub.docker.com/u/kaizenjapan/

## docker run

```
$ docker run -it -p 8888:8888 kaizenjapan/r-keras
Unable to find image 'kaizenjapan/r-keras:latest' locally
latest: Pulling from kaizenjapan/r-keras
cc1a78bfd46b: Pull complete 
314b82d3c9fe: Pull complete 
adebea299011: Extracting [==================================================>]  1.491GB/1.491GB
f7baff790e81: Download complete 
44c478e462a0: Download complete 
3adc51af53a0: Download complete 
docker: failed to register layer: Error processing tar file(exit status 1: unpigz: skipping: <stdin>: corrupted -- crc32 mismatch
): .
See 'docker run --help'.

Usage:	docker run [OPTIONS] IMAGE [COMMAND] [ARG...]

Run a command in a new container

Options:
      --add-host list                  Add a custom host-to-IP mapping (host:ip)
  -a, --attach list                    Attach to STDIN, STDOUT or STDERR
      --blkio-weight uint16            Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0)
      --blkio-weight-device list       Block IO weight (relative device weight) (default [])
      --cap-add list                   Add Linux capabilities
      --cap-drop list                  Drop Linux capabilities
      --cgroup-parent string           Optional parent cgroup for the container
      --cidfile string                 Write the container ID to the file
      --cpu-period int                 Limit CPU CFS (Completely Fair Scheduler) period
      --cpu-quota int                  Limit CPU CFS (Completely Fair Scheduler) quota
      --cpu-rt-period int              Limit CPU real-time period in microseconds
      --cpu-rt-runtime int             Limit CPU real-time runtime in microseconds
  -c, --cpu-shares int                 CPU shares (relative weight)
      --cpus decimal                   Number of CPUs
      --cpuset-cpus string             CPUs in which to allow execution (0-3, 0,1)
      --cpuset-mems string             MEMs in which to allow execution (0-3, 0,1)
  -d, --detach                         Run container in background and print container ID
      --detach-keys string             Override the key sequence for detaching a container
      --device list                    Add a host device to the container
      --device-cgroup-rule list        Add a rule to the cgroup allowed devices list
      --device-read-bps list           Limit read rate (bytes per second) from a device (default [])
      --device-read-iops list          Limit read rate (IO per second) from a device (default [])
      --device-write-bps list          Limit write rate (bytes per second) to a device (default [])
      --device-write-iops list         Limit write rate (IO per second) to a device (default [])
      --disable-content-trust          Skip image verification (default true)
      --dns list                       Set custom DNS servers
      --dns-option list                Set DNS options
      --dns-search list                Set custom DNS search domains
      --entrypoint string              Overwrite the default ENTRYPOINT of the image
  -e, --env list                       Set environment variables
      --env-file list                  Read in a file of environment variables
      --expose list                    Expose a port or a range of ports
      --group-add list                 Add additional groups to join
      --health-cmd string              Command to run to check health
      --health-interval duration       Time between running the check (ms|s|m|h) (default 0s)
      --health-retries int             Consecutive failures needed to report unhealthy
      --health-start-period duration   Start period for the container to initialize before starting health-retries countdown (ms|s|m|h)
                                       (default 0s)
      --health-timeout duration        Maximum time to allow one check to run (ms|s|m|h) (default 0s)
      --help                           Print usage
  -h, --hostname string                Container host name
      --init                           Run an init inside the container that forwards signals and reaps processes
  -i, --interactive                    Keep STDIN open even if not attached
      --ip string                      IPv4 address (e.g., 172.30.100.104)
      --ip6 string                     IPv6 address (e.g., 2001:db8::33)
      --ipc string                     IPC mode to use
      --isolation string               Container isolation technology
      --kernel-memory bytes            Kernel memory limit
  -l, --label list                     Set meta data on a container
      --label-file list                Read in a line delimited file of labels
      --link list                      Add link to another container
      --link-local-ip list             Container IPv4/IPv6 link-local addresses
      --log-driver string              Logging driver for the container
      --log-opt list                   Log driver options
      --mac-address string             Container MAC address (e.g., 92:d0:c6:0a:29:33)
  -m, --memory bytes                   Memory limit
      --memory-reservation bytes       Memory soft limit
      --memory-swap bytes              Swap limit equal to memory plus swap: '-1' to enable unlimited swap
      --memory-swappiness int          Tune container memory swappiness (0 to 100) (default -1)
      --mount mount                    Attach a filesystem mount to the container
      --name string                    Assign a name to the container
      --network string                 Connect a container to a network (default "default")
      --network-alias list             Add network-scoped alias for the container
      --no-healthcheck                 Disable any container-specified HEALTHCHECK
      --oom-kill-disable               Disable OOM Killer
      --oom-score-adj int              Tune host's OOM preferences (-1000 to 1000)
      --pid string                     PID namespace to use
      --pids-limit int                 Tune container pids limit (set -1 for unlimited)
      --platform string                Set platform if server is multi-platform capable
      --privileged                     Give extended privileges to this container
  -p, --publish list                   Publish a container's port(s) to the host
  -P, --publish-all                    Publish all exposed ports to random ports
      --read-only                      Mount the container's root filesystem as read only
      --restart string                 Restart policy to apply when a container exits (default "no")
      --rm                             Automatically remove the container when it exits
      --runtime string                 Runtime to use for this container
      --security-opt list              Security Options
      --shm-size bytes                 Size of /dev/shm
      --sig-proxy                      Proxy received signals to the process (default true)
      --stop-signal string             Signal to stop a container (default "SIGTERM")
      --stop-timeout int               Timeout (in seconds) to stop a container
      --storage-opt list               Storage driver options for the container
      --sysctl map                     Sysctl options (default map[])
      --tmpfs list                     Mount a tmpfs directory
  -t, --tty                            Allocate a pseudo-TTY
      --ulimit ulimit                  Ulimit options (default [])
  -u, --user string                    Username or UID (format: <name|uid>[:<group|gid>])
      --userns string                  User namespace to use
      --uts string                     UTS namespace to use
  -v, --volume list                    Bind mount a volume
      --volume-driver string           Optional volume driver for the container
      --volumes-from list              Mount volumes from the specified container(s)
  -w, --workdir string                 Working directory inside the container

```


# Macintosh

dockerアイコンをクリックすると次のエラーが出た。

![docker-err1.png](https://qiita-image-store.s3.amazonaws.com/0/51423/2d2299d7-6130-6c3d-b29a-c01ff41c69a6.png)

「Diagnose & Feedback」を押すと

![docker-err2.png](https://qiita-image-store.s3.amazonaws.com/0/51423/08fffee5-7653-d7fd-6985-81ef43be70a2.png)

指定したコマンドを実行してみる。

```
$ /Applications/Docker.app/Contents/Resources/bin/docker-diagnose -u
macOS: version 10.12.6 (build: 16G1036)
Docker.app: version: 18.03.1-ce-mac65 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
Local time: 2018年 10月 9日 火曜日 11時39分35秒 JST
UTC:        2018年 10月 9日 火曜日 02時39分35秒 UTC
Timestamp:  20181009-113935
Running diagnostic tests:
[OK]      Files
[ERROR]   Docker CLI       Connection refused (ECONNREFUSED) connecting to /var/run/docker.sock: check if service is running
[ERROR]   Docker CLI       Connection refused (ECONNREFUSED) connecting to /Users/administrator/Library/Containers/com.docker.docker/Data/s60: check if service is running
Error docker ps: timeout after 10.00s
[ERROR]   docker-cli       docker ps failed: (Failure "docker ps: timeout after 10.00s")
[OK]      Moby booted
[ERROR]   driver.amd64-linux com.docker.driver.amd64-linux is not running
[OK]      vmnetd
[ERROR]   osxfs            com.docker.osxfs is not running
[ERROR]   VPNKit           Unexpected error ((Failure
  "Error connecting socket to 9p endpoint unix:/Users/administrator/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ECONNREFUSED, \"connect\", \"\")")) connecting to /Users/administrator/Library/Containers/com.docker.docker/Data/s51
[ERROR]   VPNKit           com.docker.vpnkit is not running
Error docker ps: got timeout (docker ps: exit 1)

```

![docker-err3.png](https://qiita-image-store.s3.amazonaws.com/0/51423/d5c19ba9-5d43-7d3e-abe3-ba24b764cd7c.png)

![docker-err5.png](https://qiita-image-store.s3.amazonaws.com/0/51423/1b911f0b-addf-54dd-9915-5373e98a3df6.png)

![docker-err6.png](https://qiita-image-store.s3.amazonaws.com/0/51423/9f7d9e8e-3997-d04e-176e-dd7b17c1e9b8.png)

原因は分からず。再度diagnose

```
$ /Applications/Docker.app/Contents/Resources/bin/docker-diagnose -u
macOS: version 10.12.6 (build: 16G1036)
Docker.app: version: 18.03.1-ce-mac65 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
Local time: 2018年 10月 9日 火曜日 11時51分17秒 JST
UTC:        2018年 10月 9日 火曜日 02時51分17秒 UTC
Timestamp:  20181009-115117
Running diagnostic tests:
[OK]      Files
[ERROR]   Docker CLI       cannot find docker
[ERROR]   Docker CLI       /var/run/docker.sock does not exist
[ERROR]   Docker CLI       Unexpected error (No such file or directory) connecting to /var/run/docker.sock
[ERROR]   Docker CLI       /Users/administrator/Library/Containers/com.docker.docker/Data/s60 does not exist
[ERROR]   Docker CLI       Unexpected error (No such file or directory) connecting to /Users/administrator/Library/Containers/com.docker.docker/Data/s60
Error docker ps: timeout after 10.00s
[ERROR]   docker-cli       docker ps failed: (Failure "docker ps: timeout after 10.00s")
[ERROR]   Moby booted      /Users/administrator/Library/Containers/com.docker.docker/Data/vms/0/console-ring does not exist
[ERROR]   driver.amd64-linux com.docker.driver.amd64-linux is not running
[ERROR]   vmnetd           /var/tmp/com.docker.vmnetd.socket does not exist
[ERROR]   vmnetd           Unexpected error (No such file or directory) connecting to /var/tmp/com.docker.vmnetd.socket
[ERROR]   vmnetd           /private/tmp/vmnetd/com.docker.vmnetd is not running
[ERROR]   osxfs            com.docker.osxfs is not running
[ERROR]   VPNKit           Unexpected error ((Failure
  "Error connecting socket to 9p endpoint unix:/Users/administrator/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ENOENT, \"connect\", \"\")")) connecting to /Users/administrator/Library/Containers/com.docker.docker/Data/s51
[ERROR]   VPNKit           com.docker.vpnkit is not running
Error docker ps: got timeout (docker ps: exit 127)
[ERROR]   disk             No Docker.qcow2 or Docker.raw found: the VM has never been started
[OK]      environment
[OK]      Docker
[OK]      VT-x
[OK]      kern.hv_support
Most specific failure is: No Docker.qcow2 or Docker.raw found: the VM has never been started
Docker logs are being collected into /tmp/「なんやらいっぱい数字がならんでる。」/20181009-115117.tar.gz
Your unique id is: 「なんやらいっぱい数字がならんでる。」
Please quote this in all correspondence.
```


```
$ /Applications/Docker.app/Contents/Resources/bin/docker-diagnose -u
macOS: version 10.12.6 (build: 16G1036)
Docker.app: version: 18.03.1-ce-mac65 (dd2831d4b7421cf559a0881cc7a5fdebeb8c2b98)
Local time: 2018年 10月 9日 火曜日 11時58分28秒 JST
UTC:        2018年 10月 9日 火曜日 02時58分28秒 UTC
Timestamp:  20181009-115828
Running diagnostic tests:
[OK]      Files
[OK]      Docker CLI
[OK]      Moby booted
[OK]      driver.amd64-linux
[OK]      vmnetd
[OK]      osxfs
[OK]      VPNKit
[OK]      disk
[OK]      environment
[OK]      Docker
[OK]      VT-x
[OK]      kern.hv_support
Docker logs are being collected into /tmp/「なんやらいっぱい数字がならんでる。」/20181009-115828.tar.gz
Your unique id is: 「「なんやらいっぱい数字がならんでる。」」
Please quote this in all correspondence.
```

# Windows
Docker for Windows
https://qiita.com/kaizen_nagoya/items/c4daa5cf52e9f0c2c002

システム管理者権限
Hyper-Vの設定
ネットワークの設定（セキュリティ）
BIOSの設定
など掲載しています。

# 参考文献(reference)
Dockerでホストとコンテナ間でのファイルコピー
https://qiita.com/gologo13/items/7e4e404af80377b48fd5

docker 入門
https://qiita.com/kaizen_nagoya/items/2f31319e40ddaa0bf8a5


## 一覧
物理記事　上位100
https://qiita.com/kaizen_nagoya/items/66e90fe31fbe3facc6ff

量子(0) 計算機, 量子力学 
https://qiita.com/kaizen_nagoya/items/1cd954cb0eed92879fd4

数学関連記事１００
https://qiita.com/kaizen_nagoya/items/d8dadb49a6397e854c6d

言語・文学記事　１００
https://qiita.com/kaizen_nagoya/items/42d58d5ef7fb53c407d6

医工連携関連記事一覧
https://qiita.com/kaizen_nagoya/items/6ab51c12ba51bc260a82

自動車　記事　１００
https://qiita.com/kaizen_nagoya/items/f7f0b9ab36569ad409c5

通信記事１００
https://qiita.com/kaizen_nagoya/items/1d67de5e1cd207b05ef7

日本語（０）一欄
https://qiita.com/kaizen_nagoya/items/7498dcfa3a9ba7fd1e68

英語(0) 一覧
https://qiita.com/kaizen_nagoya/items/680e3f5cbf9430486c7d

転職(0)一覧
https://qiita.com/kaizen_nagoya/items/f77520d378d33451d6fe

仮説（0）一覧（目標100現在40）
https://qiita.com/kaizen_nagoya/items/f000506fe1837b3590df

Qiita(0)Qiita関連記事一覧（自分）
https://qiita.com/kaizen_nagoya/items/58db5fbf036b28e9dfa6

鉄道（０）鉄道のシステム考察はてっちゃんがてつだってくれる
https://qiita.com/kaizen_nagoya/items/26bda595f341a27901a0

安全（0）安全工学シンポジウムに向けて: 21
https://qiita.com/kaizen_nagoya/items/c5d78f3def8195cb2409

一覧の一覧( The directory of directories of mine.) Qiita(100)
https://qiita.com/kaizen_nagoya/items/7eb0e006543886138f39

Ethernet 記事一覧　Ethernet(0)
https://qiita.com/kaizen_nagoya/items/88d35e99f74aefc98794

Wireshark 一覧 wireshark(0)、Ethernet(48) 
https://qiita.com/kaizen_nagoya/items/fbed841f61875c4731d0

線網（Wi-Fi）空中線(antenna)(0) 記事一覧(118/300目標)
https://qiita.com/kaizen_nagoya/items/5e5464ac2b24bd4cd001

OSEK OS設計の基礎　OSEK(100)
https://qiita.com/kaizen_nagoya/items/7528a22a14242d2d58a3

Error一覧 error(0)
https://qiita.com/kaizen_nagoya/items/48b6cbc8d68eae2c42b8

++ Support(0)　
https://qiita.com/kaizen_nagoya/items/8720d26f762369a80514

Coding(0) Rules, C, Secure, MISRA and so on
https://qiita.com/kaizen_nagoya/items/400725644a8a0e90fbb0

プログラマによる、プログラマのための、統計(0)と確率のプログラミングとその後
https://qiita.com/kaizen_nagoya/items/6e9897eb641268766909

なぜdockerで機械学習するか 書籍・ソース一覧作成中 (目標100)
https://qiita.com/kaizen_nagoya/items/ddd12477544bf5ba85e2

言語処理100本ノックをdockerで。python覚えるのに最適。:10+12
https://qiita.com/kaizen_nagoya/items/7e7eb7c543e0c18438c4

プログラムちょい替え（0）一覧:4件
https://qiita.com/kaizen_nagoya/items/296d87ef4bfd516bc394

官公庁・学校・公的団体（NPOを含む）システムの課題、官（０）
https://qiita.com/kaizen_nagoya/items/04ee6eaf7ec13d3af4c3

「はじめての」シリーズ　 ベクタージャパン　
https://qiita.com/kaizen_nagoya/items/2e41634f6e21a3cf74eb

AUTOSAR(0)Qiita記事一覧, OSEK(75)
https://qiita.com/kaizen_nagoya/items/89c07961b59a8754c869

プログラマが知っていると良い「公序良俗」
https://qiita.com/kaizen_nagoya/items/9fe7c0dfac2fbd77a945

LaTeX(0) 一覧　
https://qiita.com/kaizen_nagoya/items/e3f7dafacab58c499792

自動制御、制御工学一覧（０）
https://qiita.com/kaizen_nagoya/items/7767a4e19a6ae1479e6b

Rust(0) 一覧　
https://qiita.com/kaizen_nagoya/items/5e8bb080ba6ca0281927

小川清最終講義、最終講義（再）計画, Ethernet(100) 英語(100) 安全(100)
https://qiita.com/kaizen_nagoya/items/e2df642e3951e35e6a53

＜この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。＞
This article is an individual impression based on the individual's experience. It has nothing to do with the organization or business to which I currently belong.
### 文書履歴(document history)
ver. 0.10 初稿 20181008
ver. 0.11 commit 追記 20181009　朝
ver. 0.12 windows, Mac  追記 20181009 午前
ver. 0.13 docker hub  追記 20181009 昼
ver. 0.14 エラーの対処方法などを追記中 20181010
ver. 0.15 説明を追記 20181011
ver. 0.16 番号変更、参考文献追記 20181027
ver. 0.17 docker run error追記 20181028
### 最後までおよみいただきありがとうございました。
いいね　💚、フォローをお願いします。
####  Thank you very much for reading to the last sentence.
Please press the like icon 💚　and follow me for your happy life.