docker - 无法连接到 unix :///var/run/docker. socks 上的 Docker 守护进程。 docker 守护进程是否正在运行?在 Dockerfile 中

标签 docker dockerfile hyperledger-fabric hyperledger hyperledger-composer

我有以下 Dockerfile:

FROM ubuntu

ENV NPM_CONFIG_LOGLEVEL warn
ENV admin_user="PeerAdmin" network_name=$1 version=$2 hversion=hlfv1     fabrik_path=/fabric-tools project_dir=$(pwd) 
ENV card_store_dir=$project_dir/.card-store stage_dir=$project_dir/.stage     env_dir=$project_dir/env is_ok=1 FABRIC_VERSION=hlfv1 

WORKDIR /app
COPY . /app

USER root
# RUN chown -R ubuntu:ubuntu .
WORKDIR /app
RUN apt-get update && \
    mkdir "$fabrik_path" && \
    cd "$fabrik_path" && \
    export FABRIC_VERSION=hlfv1 && \
    apt-get -y install apt-transport-https ca-certificates curl software-properties-common && \
    apt-get -y install curl && \
    apt-get -y install unzip && \
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && \
    apt-get -y install docker.io && \
    curl -O https://raw.githubusercontent.com/hyperledger/composer-tools/master/packages/fabric-dev-servers/fabric-dev-servers.zip && \
    unzip fabric-dev-servers.zip && \
    service docker start && \
    ./downloadFabric.sh && \
    ./startFabric.sh

尝试执行它,我收到一个错误:
**Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?**
命令如 service docker start或 systemctl 不起作用。

最佳答案

试试这个命令:

sudo service docker restart

关于docker - 无法连接到 unix :///var/run/docker. socks 上的 Docker 守护进程。 docker 守护进程是否正在运行?在 Dockerfile 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51857634/

相关文章:

docker - Keycloak docker重启后如何保持infinispan session

docker - 如何在 Mac 上使用 IntelliJ 调试 CDAP 沙箱

mysql - Docker:如何在目录中使用 SQL 文件

java - 将十六进制编码的 ESCDA 私钥转换为 Java PrivateKey 接口(interface)

linux - 用于安装特定版本的 Docker Community Edition yum CentOS 的 <version> 字符串的格式

apache-spark - 将 spark-jobserver 部署到 BlueMix Spark 节点

ubuntu - Docker:MeteorJS 安装了两次并出现一些警告

python - 构建docker镜像时无法安装sklearn

hyperledger-fabric - Hyperledger Fabric 2.1 链码安装

hyperledger-fabric - 状态 : 500, 消息:无法获取链码包