Reputation: 11
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?" when I running the following command: docker images I'm using the following 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:
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
What I'm missing?
Upvotes: 0
Views: 1993
Reputation: 3581
Try the below steps which worked for me
service docker stop
cd /var/run/docker/libcontainerd
rm -rf containerd/*
rm -f docker-containerd.pid
service docker start
docker run
Upvotes: -1