0
votes

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 ??

1
Why the python tag though? This has nothing to do with python...GPhilo
Why are you building your image FROM docker, when it seems to be a Python application? This doesn't seem to be a complete reproduction (there's no CMD and nothing you show here would cause that error); can you edit the question to include more details, including the actual application code and the actual error message?David Maze

1 Answers

0
votes

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