首页 > 解决方案 > 如何为 HyperLedger Playground 安装运行 docker?

问题描述

我是超级账本家族的新手,当我从文档https://hyperledger.github.io/composer/latest/installing/development-tools.html安装开发环境时

我停留在第 4 步:安装 Hyperledger Fabric:顺便说一下,我在 windows 中使用 Ubuntu 18.04LTS 终端(不是 bash,来自 windows 商店),它安装的 composer 版本是 0.20.8 所有先决条件都安装成功.

它显示“ Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”我尝试使用以下命令运行 docker:

$ sudo systemctl start docker
$ sudo service docker start

但是没用!!!

harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$ cd ~/fabric-dev-servers
harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$ export FABRIC_VERSION=hlfv12
harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$ ./downloadFabric.sh
Development only script for Hyperledger Fabric control
Running 'downloadFabric.sh'
FABRIC_VERSION is set to 'hlfv12'
FABRIC_START_TIMEOUT is unset, assuming 15 (seconds)
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

'''尝试运行 Docker

harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$ sudo systemctl start docker
System has not been booted with systemd as init system (PID 1). Can't operate.
harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$ sudo service docker start
 * Starting Docker: docker                                                                                                                                       [ OK ]
harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$ sudo service docker status
 * Docker is not running
harsha@LAPTOP-UDDDOD20:~/fabric-dev-servers$

如何在我的机器上成功运行 docker 服务并在本地运行 hyperledger playground?

标签: dockerdocker-composehyperledger-fabrichyperledger-composer

解决方案


您不能在 WSL 中轻松运行 docker(即您安装的 windows 商店中的 ubuntu 版本)。

原因是您正在使用的 linux 的 windows 子系统不是具有 linux 内核的 linux 的真正版本。它是一个巧妙的软件,可以动态地将 linux apis 转换为 windows apis。Docker 需要一个真正的 linux 内核才能工作。

我建议您使用诸如 windows hyper-v、vmware 或 virtualbox 之类的管理程序,并将 linux 发行版安装到 vm 中并使用它。


推荐阅读