[英]docker-compose | Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I'm getting this error on alpine base docker container: "Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?"我在 alpine base docker 容器上收到此错误:“无法连接到 unix:///var/run/docker.sock 上的 Docker 守护程序。docker 守护程序是否正在运行?” when I running the following command: docker images I'm using the following docker-compose:
当我运行以下命令时:docker images 我正在使用以下 docker-compose:
services:
alpine:
build:
context: ./
dockerfile: Dockerfile
# command: -H unix:///var/run/docker.sock
volumes:
- /var/run/docker.sock:/var/run/docker.sock
and this is my dockerFile:这是我的 dockerFile:
FROM yossigilad/alpine8:v1 AS prepare
#FROM openjdk:8-jdk-alpine AS prepare
RUN mkdir -p /app/source
#copying all project files to docker
COPY . /app/source
WORKDIR /app/source
RUN docker images
when I running the container with this command its ok docker run -ti -v /var/run/docker.sock:/var/run/docker.sock DOCKER_ID当我用这个命令运行容器时,它 docker run -ti -v /var/run/docker.sock:/var/run/docker.sock DOCKER_ID
What I'm missing?我缺少什么?
尝试以下对我有用的步骤
service docker stop
cd /var/run/docker/libcontainerd
rm -rf containerd/*
rm -f docker-containerd.pid
service docker start
docker run
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.