我有以下 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/