简体   繁体   English

在docker:dind中运行docker-compose

[英]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 . 该问题的问题在于启动docker实例,但这与通过docker-compose绑定docker相关联。

I am trying to run docker-compose inside docker:dind image. 我正在尝试在docker:dind image中运行docker:dind docker-compose So created my own image with following Dockerfile . 因此,使用以下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, 但是运行docker-compose命令会引发以下错误,

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. docker:dind的操作系统是Alpine linux。

You don't need to build docker-compose image from scratch. 您无需从头开始构建docker-compose映像。

There is official docker-compose image available on dockerhub. dockerhub上有可用的官方 docker-compose镜像。 Use that. 用那个

For instructions on how to run it, please check this out. 有关如何运行的说明,请检查出来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM