Docker是一个非常跨时代的工具,是在继虚拟化之后的新一个好用易用的工具,可以极大提升开发和部署的效率。本文将解决一个在Mac上部署Docker之时碰到的问题。

环境介绍

操作系统: MacOS 10.13.2 (17C205)
Docker 版本: 17.12.0-ce-mac47

Dock version Command:

docker version

 Client:
 Version:   17.12.0-ce
 API version:   1.35
 Go version:    go1.9.2
 Git commit:    c97c6d6
 Built: Wed Dec 27 20:03:51 2017
 OS/Arch:   darwin/amd64
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

问题表现

启动Docker,会弹出错误提示对话框:
这里写图片描述

错误信息为: Fatal Error com.docker.supervisor failed to start Exit code 1.
然后docker就启动失败了,整个docker无法正常启动….

这个docker可是我刚刚从docker的官方网站下载的最新stable版本,这个是什么鬼?我直接开始怀疑docker本身的质量问题和可靠性问题….

网上寻求帮助

在网上搜索了一番,在其官方站点上,有很多人都报出了类似问题,而且是都是在最近几天,基于最新的版本发生的问题,真是让人汗颜��, 这个质量真是让人揪心呀…..
找来找去,各种方法都适用过了,但是问题依然没有办法解决,我的心��了….

Diagnose

佛祖曰:自助者天助,求人不若求记。 于是还是立足自身来解决问题吧。根据偶十多年的经验,什么风浪没有见过,只要是技术问题,总是有相关的错误信息可以作为线索来追查的。
首先调用了报错界面上的Diagnose来进行诊断问题,可以看到很多的错误信息:

Docker for Mac: version: 17.12.0-ce-mac47 (72b93a017350990850ddc37cd341bd16fce3e911)
macOS: version 10.13.2 (build: 17C205)
logs: /tmp/C62A4FB0-A92F-41D0-ACD7-6517FCFB4B4C/20180120-205142.tar.gz
failure: com.docker.vpnkit is not running
[OK]     db.git
[OK]     vmnetd
[OK]     dns
[ERROR]  driver.amd64-linux
         com.docker.driver.amd64-linux is not running
[OK]     virtualization VT-X
[OK]     app
[ERROR]  moby
         /Users/tonychen/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/console-ring does not exist
[OK]     system
[OK]     moby-syslog
[OK]     kubernetes
[OK]     env
[OK]     virtualization kern.hv_support
[ERROR]  slirp
         Unexpected error ((Failure
  "Error connecting socket to 9p endpoint unix:/Users/tonychen/Library/Containers/com.docker.docker/Data/s51: Unix.Unix_error(Unix.ECONNREFUSED, \"connect\", \"\")")) connecting to /Users/tonychen/Library/Containers/com.docker.docker/Data/s51
         com.docker.vpnkit is not running
         slirp check failed with: Unix.Unix_error(Unix.ECONNREFUSED, "connect", "")
[ERROR]  osxfs
         com.docker.osxfs is not running
[OK]     moby-console
[OK]     logs
[ERROR]  docker-cli
         Connection refused (ECONNREFUSED) connecting to /var/run/docker.sock: check if service is running
         Connection refused (ECONNREFUSED) connecting to /Users/tonychen/Library/Containers/com.docker.docker/Data/s60: check if service is running
         docker ps failed
[OK]     menubar
[OK]     disk

从错误信息中发现了若干个关键词: vpnkit,moby。于是顺藤摸瓜尝试查找相关信息,找到了类似的信息:
https://docs.docker.com/docker-for-mac/install/#what-to-know-before-you-install 中找到了相关信息:

Relationship to Docker Machine: Installing Docker for Mac does not affect machines you created with Docker Machine. You’ll get the option to copy containers and images from your local default machine (if one exists) to the new Docker for Mac HyperKit VM. When you are running Docker for Mac, you do not need Docker Machine nodes running at all locally (or anywhere else). With Docker for Mac, you have a new, native virtualization system running (HyperKit) which takes the place of the VirtualBox system. To learn more, see Docker for Mac vs. Docker Toolbox.

从上文中可知,hyperkit是docker for mac的依赖包,应该是需要提前安装的。难道我的问题就是由于这个未安装造成的吗?

Hyperkit 和Moby

项目主页: https://github.com/moby/hyperkit
在页面主页中涉及到了若干安装HyperKit的相关信息,这里使用Brew来进行包的安装,关于Brew的安装和使用,这里不再赘述,不懂的童鞋可以自行上网搜索安装和使用指南。

brew install opam libev

结果输出为:

Updating Homebrew...
^C
==> Installing dependencies for opam: ocaml, ocamlbuild, camlp4, clingo, aspcud
==> Installing opam dependency: ocaml

==> Downloading https://homebrew.bintray.com/bottles/ocaml-4.06.0.high_sierra.bottle.tar.gz
^C
TonydeMBP:smartpdf tonychen$ brew install opam libev
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (homebrew/core, caskroom/cask).
==> New Formulae
auditbeat         bioawk            diamond           go-statik         kallisto          mmseqs2           picard-tools      spades            tnftpd            yq
augustus          blast             elektra           gox               kumo              monero            samtools          sratoolkit        travis
bamtools          bwa               fastqc            hlint             lammps            mpir              seqtk             stress-ng         vcftools
bcftools          cp2k              field3d           hmmer             libjwt            opencascade       sickle            telnetd           vis
bedops            darksky-weather   glances           jdupes            libtomcrypt       orocos-kdl        skafos            tnftp             visp
==> Updated Formulae
abcm2ps                       datomic                       gpg-agent                     libtiff ✔                     pgplot                        sphinx-doc
abcmidi                       davmail                       gradle                        libtorrent-rasterbar          pgpool-ii                     spigot
abyss                         dcm2niix                      gradle-completion             libu2f-server                 pgrouting                     spin
ack                           dcos-cli                      grc                           libuv                         pianod                        sql-translator
acpica                        ddgr                          grib-api                      libvirt                       pick                          sqlcipher
agda                          debianutils                   gromacs                       libxc                         picocom                       sqlmap
algernon                      dehydrated                    gron                          libzdb                        pigz                          squashfs
allure                        devd                          groonga                       link-grammar                  pilosa                        ssh-audit
amazon-ecs-cli                diff-so-fancy                 grpc                          linkerd                       pipenv                        sshguard
angband                       diffoscope                    gsoap                         liquigraph                    pius                          sslscan
angular-cli                   digdag                        gspell                        llnode                        pjproject                     sslsplit
ansible                       ditaa                         gst-plugins-bad               llvm                          plantuml                      sslyze
ansible-lint                  django-completion             gst-plugins-base              logstash                      platformio                    statik
antigen                       dlib                          gtk+                          logtalk                       plplot                        stubby
apache-arrow                  dmd                           gtkspell3                     lwtools                       pngquant                      subversion
apache-opennlp                docfx                         guile                         lxc                           poco                          suite-sparse
apache-spark                  docker                        guile@2.0                     lynis                         pod2man                       sundials
apktool                       docker-completion             gxml                          lysp                          ponyc                         svgcleaner
apm-server                    docker-compose                gzip                          lz4                           ponysay                       svtplay-dl
app-engine-go-64              docker-compose-completion     hadolint                      macosvpn                      postgis                       swagger-codegen
app-engine-java               docker-gen                    haproxy                       macvim                        postgrest                     swi-prolog
arangodb                      docker-machine-nfs            harfbuzz ✔                    magic-wormhole                povray                        swiftformat
argon2                        doxygen                       haskell-stack                 mame                          pre-commit                    swiftlint
argyll-cms                    dpkg                          haste-client                  mariadb                       presto                        sword
armadillo                     dub                           heartbeat                     mariadb@10.1                  prometheus                    syncthing
armor                         duck                          heroku                        mdp                           proof-general                 sysbench
arpack                        dungeon                       hg-flow                       media-info                    protobuf                      sysdig
artifactory                   duplicity                     hh                            mediaconch                    pspg                          taisei
asciinema                     e2fsprogs                     hledger                       memcached                     psqlodbc                      taktuk
asdf                          ecl                           homebank                      menhir                        pushpin                       talloc
astyle                        ejabberd                      htop                          mercurial                     pwntools                      tbb
ats2-postiats                 elasticsearch                 http-server                   meson                         py3cairo                      tcl-tk
autogen                       elixir                        httpd                         mesos                         pybind11                      tclap
aws-elasticbeanstalk          elvish                        httpie                        metaproxy                     pyenv                         telegraf
aws-sdk-cpp                   emscripten                    hugo                          metricbeat                    pygobject                     teleport
awscli                        enchant                       hwloc                         mikutter                      pypy                          terraform
azure-cli                     enigma                        hydra                         miller                        pypy3                         terraform_landscape
babl                          entr                          hypre                         mingw-w64                     pyqt                          terragrunt
backupninja                   ephemeralpg                   ib                            minio-mc                      python ✔                      texmath
bandcamp-dl                   erlang ✔                      ibex                          miniupnpc                     python3                       thefuck
baresip                       etcd                          idnits                        minizinc                      pytouhou                      tig
bartycrouch                   etsh                          idris                         mitmproxy                     qd                            tile38
basex                         exim                          igv                           mksh                          qjackctl                      tin
bash-git-prompt               exomizer                      imagemagick                   mkvtoolnix                    qmmp                          tintin
bash-preexec                  exploitdb                     imagemagick@6                 modules                       qpdf                          tnef
bash-snippets                 faad2                         immortal                      molecule                      qpid-proton                   todoman
bazel                         faas-cli                      innotop                       mongo-c-driver                qrupdate                      tokei
bdw-gc                        fabio                         ipython                       mongodb                       qscintilla2                   tomcat-native
bear                          fades                         ipython@5                     moreutils                     qt                            tor
bento4                        fail2ban                      iron-functions                mpd                           quex                          tracebox
bettercap                     fb-client                     irssi                         mpfi                          quicktype                     traefik
betty                         fbi-servefiles                iso-codes                     mpfr                          r                             trafficserver
binaryen                      fd                            jags                          mpich                         rabbitmq ✔                    translate-shell
bind                          fdclone                       jena                          mpv                           radamsa                       transmission
binwalk                       fdroidserver                  jenkins                       mr                            radare2                       ttf2eot
biogeme                       feh                           jenkins-job-builder           mruby                         rancher-cli                   ttfautohint ✔
bit                           fftw                          jenkins-lts                   mutt                          ratfor                        tth
bitcoin                       fibjs                         jetty                         mycli                         rbenv-aliases                 ttyd
bitrise                       filebeat                      jetty-runner                  mypy                          rbenv-binstubs                ttyrec
blackbox                      fio                           jfrog-cli-go                  mysql ✔                       rbenv-bundle-exec             twarc
blastem                       firebase-cli                  jhipster                      mysql++                       rbenv-bundler                 twoping
boost                         fish                          joe                           mysql-connector-c++           rbenv-bundler-ruby-version    twtxt
boost-bcp                     flatcc                        joplin                        mysql-sandbox                 rbenv-chefdk                  txr
boost-build                   flow                          json-fortran                  mysql@5.5                     rbenv-communal-gems           u-boot-tools
boost-mpi                     fluent-bit                    jsoncpp                       mysql@5.6                     rbenv-ctags                   uftp
boost-python                  fluid-synth                   juju                          mytop                         rbenv-default-gems            uhd
botan                         fmt                           juju-wait                     nano                          rbenv-gemset                  unbound
bowtie2                       fn                            jump                          nats-streaming-server         rbenv-use                     unixodbc
braid                         fobis                         just                          ncmpcpp                       rbenv-vars                    unoconv
bsponmpi                      folly                         kafka                         nco                           rbenv-whatis                  urh
bubbros                       fonttools                     karn                          neko                          rclone                        vapoursynth
buku                          format-udf                    kedge                         netcdf                        re2                           vault
bzt                           fox                           keepassc                      newsboat                      rebar@3                       vcdimager
cake                          freetds                       khal                          nghttp2                       recutils                      vdirsyncer
cargo-completion              freetype ✔                    khard                         ngrep                         restic                        veclibfort
cask                          frugal                        kibana                        nifi                          rex                           verilator
cayley                        gammu                         kitchen-sync                  nikto                         riemann                       vim
ccache                        gauge                         kite                          nnn                           rocksdb                       vim@7.4
ccm                           gawk                          knot                          node                          rom-tools                     vips
ceres-solver                  gcc                           kobalt                        node-build                    root                          vte
certbot                       gcc@5                         kompose                       node@6                        roswell                       vtk
cfengine                      gcc@6                         konoha                        node@8                        rpm                           vultr
cgal                          gdbm ✔                        kontena                       nomad                         rtags                         w-calc
cgrep                         gdcm                          kotlin                        noti                          rtv                           w3m
chakra                        gedit                         kpcli                         notmuch                       ruby                          watson
chamber                       geeqie                        kubeless                      nq                            ruby-build                    weboob
charm-tools                   geoip                         kubernetes-cli                nrpe                          ruby@1.9                      webpack
cheat                         get-flash-videos              languagetool                  nspr                          ruby@2.0                      websocketd
check_postgres                get_iplayer                   latexila                      numpy                         ruby@2.1                      weechat
checkstyle                    getdns                        ldc                           nvc                           ruby@2.2                      wesnoth
chisel                        getmail                       ledger                        octave                        ruby@2.3                      wget
chromedriver                  gexiv2                        lensfun                       offlineimap                   rust                          whatmp3
chronograf                    ghi                           lgogdownloader                ola                           rustup-init                   whohas
chuck                         gifsicle                      libatomic_ops                 onioncat                      s3fs                          whois
cimg                          gifski                        libbitcoin                    ooniprobe                     s6                            widelands
citus                         gimme                         libbitcoin-blockchain         open-mpi                      sagittarius-scheme            wiggle
clipper                       gist                          libbitcoin-database           openblas                      sassc                         wine
clojure                       git                           libbitcoin-explorer           opencoarrays                  sbcl                          winetricks
closure-compiler              git-annex                     libbitcoin-node               opencolorio                   sbt                           wireguard-tools
cmake                         git-cola                      libbitcoin-server             opencv                        scalapack                     wireshark
cmark-gfm                     git-secret                    libcddb                       opencv@2                      sccache                       wolfssl
cockroach                     git-town                      libcdio                       openshift-cli                 scipy                         wpscan
coffeescript                  gitbucket                     libcds                        openssl@1.1                   scummvm                       writerperfect
compcert                      gitg                          libconfig                     openttd                       scummvm-tools                 wtf
conan                         github-keygen                 libcouchbase                  osm2pgrouting                 sdl_mixer                     wwwoffle
conjure-up                    gitlab-runner                 libdvdcss                     osm2pgsql                     selecta                       wxpython
convox                        gjs                           libdvdnav                     osquery                       serialosc                     x3270
corebird                      glib ✔                        libdvdread                    osrm-backend                  serveit                       xcenv
coreutils                     gmime                         libfabric                     overmind                      sfcgal                        xmrig
corsixth                      gmsh                          libgetdata                    packetbeat                    shadowsocks-libev             xonsh
coturn                        gmt                           libgig                        packmol                       shairport-sync                xvid
couchdb                       gmt@4                         libgosu                       paket                         shfmt                         xxhash
cppad                         gnome-builder                 libjson-rpc-cpp               pandoc                        shmcat                        yaf
cppcheck                      gnome-doc-utils               libmaxminddb                  pandoc-citeproc               shunit2                       yara
cppcms                        gnome-recipes                 libmonome                     pandoc-crossref               shyaml                        yaze-ag
cracklib                      gnu-smalltalk                 libmpc                        parallel                      simgrid                       ykpers
creduce                       gnu-tar                       libmspub                      pari                          sip                           yle-dl
cromwell                      gnumeric                      libpagemaker                  pass                          sjk                           you-get
crosstool-ng                  gnupg                         libphonenumber                passpie                       smlnj                         youtube-dl
crowdin                       gnupg@2.0                     libpqxx                       pcl                           snakemake                     z3
cryfs                         gnuradio                      libqalculate                  pcsc-lite                     snapcraft                     zabbix
crystal-icr                   gnutls                        libre                         pdf2htmlex ✔                  snappy                        zero-install
crystal-lang                  go                            librealsense                  pdftoedn                      snapraid                      zile
csvkit                        gobuster                      libressl                      pegtl                         sngrep                        zimg
csvtomd                       goffice                       librsvg                       percona-server                snort                         zplug
ctop                          gollum                        libsass                       percona-toolkit               solr                          zsh
cucumber-cpp                  gom                           libsigsegv                    pex                           sonarqube                     zstd
czmq                          goofys                        libsoup                       pg_top                        source-highlight
dar                           googler                       libstfl                       pgbouncer                     sourcery
datetime-fortran              gopass                        libtasn1                      pgcli                         spdlog
==> Renamed Formulae
camlistore -> perkeep
==> Deleted Formulae
antlr@3                             docker@1.11                         juju@1.25                           logstash@5.6                        selenium-server-standalone@2.45
apache-spark@1.5                    eigen@3.2                           kubernetes-cli@1.3                  mongodb@2.6                         srtp@1.6
apache-spark@1.6                    glfw@2                              laszip@2                            open-mpi@1.6                        stklos
autoconf@2.64                       go@1.5                              ledger@2.6                          otto                                swig@2
automake@1.12                       grails@2.5                          libpng@1.2                          percona-server@5.5                  unison@2.40
azure-cli@1                         gsl@1                               libpqxx@3                           perl@5.14                           zeromq@3.2
bazel@0.2                           influxdb@0.8                        libxml2@2.7                         pond                                zeromq@4.0
clang-format@3.8                    jetty@8                             litmus                              ponscripter-sekai                   zeromq@4.1
cloudbees-sdk                       jpeg@6                              logstash@2.4                        redis@2.6

==> Installing dependencies for opam: ocaml, ocamlbuild, camlp4, clingo, aspcud
==> Installing opam dependency: ocaml
==> Downloading https://homebrew.bintray.com/bottles/ocaml-4.06.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ocaml-4.06.0.high_sierra.bottle.tar.gz
==> Using the sandbox
��  /usr/local/Cellar/ocaml/4.06.0: 1,989 files, 225.6MB
==> Installing opam dependency: ocamlbuild
==> Downloading https://homebrew.bintray.com/bottles/ocamlbuild-0.12.0.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring ocamlbuild-0.12.0.high_sierra.bottle.tar.gz
��  /usr/local/Cellar/ocamlbuild/0.12.0: 30 files, 7.5MB
==> Installing opam dependency: camlp4
==> Downloading https://homebrew.bintray.com/bottles/camlp4-4.06+1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring camlp4-4.06+1.high_sierra.bottle.tar.gz
��  /usr/local/Cellar/camlp4/4.06+1: 165 files, 147.9MB
==> Installing opam dependency: clingo
==> Downloading https://homebrew.bintray.com/bottles/clingo-5.2.2.high_sierra.bottle.1.tar.gz
######################################################################## 100.0%
==> Pouring clingo-5.2.2.high_sierra.bottle.1.tar.gz
��  /usr/local/Cellar/clingo/5.2.2: 18 files, 6.2MB
==> Installing opam dependency: aspcud
==> Downloading https://homebrew.bintray.com/bottles/aspcud-1.9.4_1.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring aspcud-1.9.4_1.high_sierra.bottle.tar.gz
��  /usr/local/Cellar/aspcud/1.9.4_1: 11 files, 445.5KB
==> Installing opam
==> Downloading https://homebrew.bintray.com/bottles/opam-1.2.2_4.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring opam-1.2.2_4.high_sierra.bottle.tar.gz
==> Caveats
OPAM uses ~/.opam by default for its package database, so you need to
initialize it first by running (as a normal user):

$  opam init

Run the following to initialize your environment variables:

$  eval `opam config env`

To export the needed variables every time, add them to your dotfiles.
  * On Bash, add them to `~/.bash_profile`.
  * On Zsh, add them to `~/.zprofile` or `~/.zshrc` instead.

Documentation and tutorials are available at https://opam.ocaml.org, or
via "man opam" and "opam --help".

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d

zsh completions have been installed to:
  /usr/local/share/zsh/site-functions
==> Summary
��  /usr/local/Cellar/opam/1.2.2_4: 31 files, 16.3MB
==> Downloading https://homebrew.bintray.com/bottles/libev-4.24.high_sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libev-4.24.high_sierra.bottle.tar.gz
��  /usr/local/Cellar/libev/4.24: 12 files, 432.8KB

opam init

结果输出信息为:

Checking for available remotes: rsync and local, git.
  - you won't be able to use mercurial repositories unless you install the hg command on your system.
  - you won't be able to use darcs repositories unless you install the darcs command on your system.


=-=- Fetching repository information =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[default] synchronized from https://opam.ocaml.org

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-> installed base-bigarray.base
-> installed base-threads.base
-> installed base-unix.base
Done.

In normal operation, OPAM only alters files within ~/.opam.

During this initialisation, you can allow OPAM to add information to two
other files for best results. You can also make these additions manually
if you wish.

If you agree, OPAM will modify:

  - ~/.bash_profile (or a file you specify) to set the right environment
    variables and to load the auto-completion scripts for your shell (bash)
    on startup. Specifically, it checks for and appends the following line:

    . /Users/tonychen/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true


  - ~/.ocamlinit to ensure that non-system installations of `ocamlfind`
    (i.e. those installed by OPAM) will work correctly when running the
    OCaml toplevel. It does this by adding $OCAML_TOPLEVEL_PATH to the list
    of include directories.

If you choose to not configure your system now, you can either configure
OPAM manually (instructions will be displayed) or launch the automatic setup
later by running:

   opam config setup -a


Do you want OPAM to modify ~/.bash_profile and ~/.ocamlinit?
(default is 'no', use 'f' to name a file other than ~/.bash_profile)
    [N/y/f] y

User configuration:
  Generating ~/.ocamlinit.
  Updating ~/.bash_profile.
Global configuration:
  Updating ~/.opam/opam-init/init.sh
  Updating ~/.opam/opam-init/init.zsh
  Updating ~/.opam/opam-init/init.csh
  Updating ~/.opam/opam-init/init.fish
# To setup the new switch in the current shell, you need to run:
eval `opam config env`

eval opam config env

结果输出为:

TonydeMBP:hyperkit tonychen$ opam install uri qcow.0.10.3 conduit.1.0.0 lwt.3.1.0 qcow-tool mirage-block-unix.2.9.0 conf-libev logs fmt mirage-unix prometheus-app
The following dependencies couldn't be met:
  - qcow-tool -> qcow = 0.10.4
  - qcow-tool -> sha = 1.9
Your request can't be satisfied:
  - Conflicting version constraints for qcow
  - sha.1.9 is not available because your system doesn't comply with ocaml-version < "4.06.0".

No solution found, exiting

又是一个很纠结的问题, 提示sha不可用,qcow-tool的版本冲突。该如何处理呢?

处理冲突和包缺失

尝试了一下指令: brew install sha
结果输出为:

Error: No available formula with the name "sha" 
==> Searching for a previously deleted formula...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

Error: No previously deleted formula found.
==> Searching for similarly named formulae...
These similarly named formulae were found:
libgfshare            plowshare             sha1dc                shadowsocks-libev     shairport-sync        shapelib              shellshare            wireshark
md5sha1sum            remarshal             sha2                  shairport             shakespeare           shared-mime-info      termshare
To install one of them, run (for example):
  brew install libgfshare
==> Searching taps...
Error: No formulae found in taps.

于是就直接安装qcow-tool指令

opam install qcow-tool

结果输出为:

The following actions will be performed:
  ∗  install result                    1.2         [required by qcow-tool]
  ∗  install conf-m4                   1           [required by ocamlfind]
  ∗  install ocamlbuild                0.12.0      [required by logs, cmdliner, astring, etc.]
  ∗  install ocamlfind                 1.7.3-1     [required by qcow-tool]
  ∗  install uchar                     0.0.2       [required by fmt]
  ∗  install topkg                     0.9.1       [required by logs, cmdliner, astring, etc.]
  ∗  install ppx_tools                 5.1+4.06.0  [required by qcow]
  ∗  install num                       1.1         [required by sexplib]
  ∗  install jbuilder                  1.0+beta16  [required by qcow-tool]
  ∗  install base-bytes                base        [required by mirage-block-lwt]
  ∗  install unix-type-representations 0.1.1       [required by qcow-tool]
  ∗  install rresult                   0.5.0       [required by mirage-block-unix]
  ∗  install cmdliner                  1.0.2       [required by qcow-tool]
  ∗  install astring                   0.8.3       [required by qcow-tool]
  ∗  install asetmap                   0.8.1       [required by prometheus]
  ∗  install sha                       1.12        [required by qcow-tool]
  ∗  install sexplib                   v0.10.0     [required by qcow-tool]
  ∗  install ppx_traverse_builtins     v0.10.0     [required by ppx_core, ppx_metaquot]
  ∗  install ppx_derivers              1.0         [required by ppx_type_conv]
  ∗  install ocaml-migrate-parsetree   1.0.7       [required by lwt]
  ∗  install ocaml-compiler-libs       v0.10.0     [required by ppx_core]
  ∗  install stringext                 1.5.0       [required by uri]
  ∗  install re                        1.7.1       [required by uri, prometheus]
  ∗  install cppo                      1.6.0       [required by lwt]
  ∗  install fmt                       0.8.5       [required by qcow-tool]
  ∗  install cstruct                   3.2.1       [required by qcow-tool]
  ∗  install base                      v0.10.0     [required by configurator]
  ∗  install ppx_tools_versioned       5.0.1       [required by lwt]
  ∗  install ppx_ast                   v0.10.0     [required by ppx_core]
  ∗  install mirage-flow               1.3.0       [required by mirage-types]
  ∗  install mirage-device             1.1.0       [required by mirage-block, mirage-time]
  ∗  install mirage-random             1.1.0       [required by mirage-types-lwt]
  ∗  install stdio                     v0.10.0     [required by configurator]
  ∗  install lwt                       3.2.1       [required by qcow-tool]
       For the PPX, please install package lwt_ppx
       For Lwt_log and Lwt_daemon, please install package lwt_log
  ∗  install mirage-channel            3.1.0       [required by mirage-channel-lwt, mirage-types]
  ∗  install mirage-time               1.1.0       [required by qcow-tool]
  ∗  install mirage-protocols          1.2.0       [required by mirage-protocols-lwt, mirage-types]
  ∗  install mirage-net                1.1.1       [required by mirage-net-lwt, mirage-types]
  ∗  install mirage-kv                 1.1.1       [required by mirage-types]
  ∗  install mirage-fs                 1.1.1       [required by mirage-fs-lwt, mirage-types]
  ∗  install mirage-console            2.3.5       [required by mirage-console-lwt, mirage-types]
  ∗  install mirage-clock              1.3.0       [required by mirage-clock-lwt, mirage-types]
  ∗  install mirage-block              1.1.0       [required by qcow-tool]
  ∗  install ppx_core                  v0.10.0     [required by ppx_sexp_conv]
  ∗  install configurator              v0.10.0     [required by io-page]
  ∗  install prometheus                0.5         [required by qcow]
  ∗  install logs                      0.6.2       [required by qcow-tool]
  ∗  install cstruct-lwt               3.2.1       [required by mirage-block-unix]
  ∗  install mirage-time-lwt           1.1.0       [required by qcow-tool]
  ∗  install mirage-stack              1.1.0       [required by mirage-stack-lwt, mirage-types]
  ∗  install mirage-kv-lwt             1.1.0       [required by mirage-types-lwt]
  ∗  install mirage-clock-lwt          1.3.0       [required by mirage-types-lwt]
  ∗  install ppx_optcomp               v0.10.0     [required by ppx_driver]
  ∗  install io-page                   2.0.1       [required by qcow-tool]
  ∗  install mirage-flow-lwt           1.4.0       [required by mirage-types-lwt]
  ∗  install mirage-console-lwt        2.3.5       [required by mirage-types-lwt]
  ∗  install mirage-types              3.0.7       [required by mirage-types-lwt]
  ∗  install mirage-fs-lwt             1.1.1       [required by mirage-types-lwt]
  ∗  install ppx_driver                v0.10.2     [required by ppx_sexp_conv]
  ∗  install mirage-block-lwt          1.1.0       [required by qcow-tool]
  ∗  install io-page-unix              2.0.1       [required by mirage-block-unix, qcow]
  ∗  install mirage-channel-lwt        3.1.0       [required by mirage-types-lwt]
  ∗  install ppx_metaquot              v0.10.0     [required by ppx_sexp_conv]
  ∗  install ppx_type_conv             v0.10.0     [required by qcow]
  ∗  install ppx_sexp_conv             v0.10.0     [required by qcow]
  ∗  install uri                       1.9.6       [required by mirage-block-unix]
  ∗  install ipaddr                    2.8.0       [required by mirage-types-lwt]
  ∗  install mirage-block-unix         2.9.0       [required by qcow-tool]
  ∗  install mirage-stack-lwt          1.1.0       [required by mirage-types-lwt]
  ∗  install mirage-protocols-lwt      1.2.0       [required by mirage-types-lwt]
  ∗  install mirage-net-lwt            1.1.0       [required by mirage-types-lwt]
  ∗  install mirage-types-lwt          3.0.7       [required by qcow-tool]
  ∗  install qcow                      0.10.4      [required by qcow-tool]
  ∗  install qcow-tool                 0.10.5    
===== ∗  74 =====
Do you want to continue ? [Y/n] y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  �� 

[default] https://opam.ocaml.org/archives/asetmap.0.8.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/astring.0.8.3+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/base.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/cmdliner.1.0.2+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/configurator.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/cppo.1.6.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/cstruct-lwt.3.2.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/fmt.0.8.5+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/io-page.2.0.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/io-page-unix.2.0.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ipaddr.2.8.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/logs.0.6.2+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/lwt.3.2.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-block.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-block-lwt.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/cstruct.3.2.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-block-unix.2.9.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-channel-lwt.3.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-clock.1.3.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-clock-lwt.1.3.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-console.2.3.5+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-console-lwt.2.3.5+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-device.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-flow.1.3.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-channel.3.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-flow-lwt.1.4.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-fs.1.1.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/jbuilder.1.0+beta16+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-kv.1.1.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-fs-lwt.1.1.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-kv-lwt.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-net.1.1.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-net-lwt.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-random.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-stack.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-protocols.1.2.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-protocols-lwt.1.2.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-time.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-time-lwt.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-stack-lwt.1.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-types.3.0.7+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/mirage-types-lwt.3.0.7+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ocaml-compiler-libs.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/num.1.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ocamlbuild.0.12.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ocamlfind.1.7.3-1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_ast.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_core.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_driver.v0.10.2+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_metaquot.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_optcomp.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_sexp_conv.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_tools.5.1+4.06.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_tools_versioned.5.0.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_traverse_builtins.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_type_conv.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ppx_derivers.1.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/prometheus.0.5+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/qcow.0.10.4+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/qcow-tool.0.10.5+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/re.1.7.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/rresult.0.5.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/result.1.2+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/sexplib.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/sha.1.12+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/stdio.v0.10.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/stringext.1.5.0+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/topkg.0.9.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/unix-type-representations.0.1.1+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/uchar.0.0.2+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/uri.1.9.6+opam.tar.gz downloaded
[default] https://opam.ocaml.org/archives/ocaml-migrate-parsetree.1.0.7+opam.tar.gz downloaded

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  �� 
∗  installed conf-m4.1
∗  installed result.1.2
∗  installed ocamlfind.1.7.3-1
∗  installed base-bytes.base
∗  installed ppx_tools.5.1+4.06.0
∗  installed num.1.1
∗  installed ocamlbuild.0.12.0
∗  installed uchar.0.0.2
∗  installed jbuilder.1.0+beta16
∗  installed cppo.1.6.0
∗  installed ocaml-compiler-libs.v0.10.0
∗  installed topkg.0.9.1
∗  installed ppx_derivers.1.0
∗  installed asetmap.0.8.1
∗  installed astring.0.8.3
∗  installed ppx_traverse_builtins.v0.10.0
∗  installed cmdliner.1.0.2
∗  installed rresult.0.5.0
∗  installed fmt.0.8.5
∗  installed re.1.7.1
∗  installed mirage-device.1.1.0
∗  installed mirage-flow.1.3.0
∗  installed mirage-block.1.1.0
∗  installed mirage-channel.3.1.0
∗  installed sexplib.v0.10.0
∗  installed mirage-console.2.3.5
∗  installed mirage-clock.1.3.0
∗  installed ocaml-migrate-parsetree.1.0.7
∗  installed mirage-fs.1.1.1
∗  installed cstruct.3.2.1
∗  installed mirage-kv.1.1.1
∗  installed mirage-net.1.1.1
∗  installed mirage-protocols.1.2.0
∗  installed mirage-random.1.1.0
∗  installed mirage-time.1.1.0
∗  installed mirage-stack.1.1.0
∗  installed mirage-types.3.0.7
∗  installed sha.1.12
∗  installed stringext.1.5.0
∗  installed unix-type-representations.0.1.1
∗  installed ppx_ast.v0.10.0
∗  installed base.v0.10.0
∗  installed ppx_tools_versioned.5.0.1
∗  installed stdio.v0.10.0
∗  installed configurator.v0.10.0
∗  installed io-page.2.0.1
∗  installed io-page-unix.2.0.1
∗  installed lwt.3.2.1
∗  installed ppx_core.v0.10.0
∗  installed mirage-clock-lwt.1.3.0
∗  installed cstruct-lwt.3.2.1
∗  installed mirage-kv-lwt.1.1.0
∗  installed mirage-time-lwt.1.1.0
∗  installed mirage-console-lwt.2.3.5
∗  installed mirage-fs-lwt.1.1.1
∗  installed logs.0.6.2
∗  installed prometheus.0.5
∗  installed mirage-flow-lwt.1.4.0
∗  installed mirage-block-lwt.1.1.0
∗  installed mirage-channel-lwt.3.1.0
∗  installed ppx_optcomp.v0.10.0
∗  installed ppx_driver.v0.10.2
∗  installed ppx_metaquot.v0.10.0
∗  installed ppx_type_conv.v0.10.0
∗  installed ppx_sexp_conv.v0.10.0
∗  installed ipaddr.2.8.0
∗  installed mirage-net-lwt.1.1.0
∗  installed mirage-stack-lwt.1.1.0
∗  installed mirage-protocols-lwt.1.2.0
∗  installed mirage-types-lwt.3.0.7
∗  installed uri.1.9.6
∗  installed mirage-block-unix.2.9.0
∗  installed qcow.0.10.4
∗  installed qcow-tool.0.10.5
Done.

=-=- lwt.3.2.1 installed successfully -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  �� 
=> Lwt 4.0.0 will make some breaking changes in March 2018. See
     https://github.com/ocsigen/lwt/issues/453

从上述结果中,可以发现qcow和sha都被正确的安装了,擦了一头冷汗,一个docker怎么需要这么多的依赖呀。。。。

问题修复

重新启动docker的桌面工具,然后可以正常使用了,且没有报出fatal error的问题了。问题解决了。。。内心很欢喜的样子。。。。

总结

这里解决问题的思路,还是基于错误信息来分析,查找可用的线索,然后基于可用的线索和方向,进行尝试,从而可以找到问题的解决方式,一般来说,只要有问题,就一定有线索。想起在《白夜追凶》中有位主人公说到,只有犯罪分子到过现场,就一定会与现场发生物质交换,就一定会在现场留下痕迹。在解决技术问题之时,同理也是适用的。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐