Oshin aggrawal
Oshin aggrawal

Reputation: 79

ERROR :Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running

I am facing the below error with docker dind when running docker image ls inside container
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Below is my dockerfile

    FROM docker:latest

RUN apk add --no-cache --update --virtual .build-deps python3-dev build-base \
            linux-headers libffi-dev openssl-dev py3-pip

RUN pip install --upgrade pip

RUN pip3 install cryptography==2.8

RUN pip3 install docker-compose


COPY . /src/onboarding

COPY Portal_TEST /usr/lib/python3.8/site-packages/Portal_TEST
~

Do I need some libraries ??

Upvotes: 2

Views: 5097

Answers (1)

GPhilo
GPhilo

Reputation: 19123

You need to map the host's docker socket into the container, if you want to be able to run docker commands inside of it. When you docker run, add:

-v /var/run/docker.sock:/var/run/docker.sock

Upvotes: 1

Related Questions