Error when running docker compose - Couldn't connect to Docker daemon at http+docker://localunixsocket

I’m trying to install Lemur (Netflix open source project) which is installed via docker-compose, you can see it here
https://www.google.co.il/search?hl=iw&q=lemur+docker

I want to install in a dind container.
Here is my Dockerfile file:

FROM docker
RUN mkdir -p /src/
WORKDIR /src/
COPY docker-compose.yml /src/
COPY nginx /src/nginx/
COPY OSSMETADATA /src/
COPY web /src/web/

COPY docker-entrypoint.sh /src/
RUN chmod 755 /src/docker-entrypoint.sh

USER root

ENTRYPOINT ["./docker-entrypoint.sh"]

This is my entry script:

#!/bin/sh
apk add --no-cache py-pip
pip install docker-compose
docker-compose up

During execution of ‘docker-compose up’ I get the following error:

Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

Note that is I execute ‘docker-compose’ directly on my machine I do not encounter any issues.

Please advise.

you don’t typically run docker IN a container… maybe in a virtual machine…(complete OS).

some users have used a shared socket to issue docker commands IN a container, which create/manipulate containers on the host system again…

I want to run a container, which has a docker installed on it (docker-in-docker) and from it run the docker-compose.

as far as I know, you cannot do that… the docker daemon is running on the host, and does not run in a container.

if you have the right system you can ‘mount’ the docker socket (using -v), and issue a limited set of commands thru it, but this executes on the HOST os, not IN the container…

read this and see the dind repo on github…

https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/

Managed to resolve the issue with adding -v and the volume.

If you have a need to run Docker compose inside a Docker container, check out this new container runtime (aka runc) from Nestybox. It allows running Docker and Docker-Compose inside a Docker container, with total isolation from the host and without using privileged containers.