Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run docker-compose inside docker:dind

This question is not the duplicate of this. The issue in that question is with starting a docker instance but this one is associated with binding docker with docker-compose.

I am trying to run docker-compose inside docker:dind image. So created my own image with following Dockerfile.

FROM docker:dind
RUN apk add py-pip
RUN apk add python-dev libffi-dev openssl-dev gcc libc-dev make
RUN pip install docker-compose
RUN addgroup ${USER} docker

But running docker-compose command throws following error,

yarn run v1.16.0
$ docker-compose -f docker-compose.yml run test
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

lerna ERR! yarn run test stderr:
Couldn't connect to Docker daemon at http+docker://localhost - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
error Command failed with exit code 1.

How can it be fixed. The os in docker:dind is Alpine linux.

like image 943
Asur Avatar asked Dec 28 '25 21:12

Asur


1 Answers

You don't need to build docker-compose image from scratch.

There is official docker-compose image available on dockerhub. Use that.

For instructions on how to run it, please check this out.

like image 86
mchawre Avatar answered Dec 31 '25 13:12

mchawre