问题描述
我对Docker来说还很陌生,并且正在中找到文档,并尝试部署使用docker-compose 1.14.0在dind内部的几个容器我得到以下内容
I am pretty new to docker and was following the documentation found here, trying deploy several containers inside dind using docker-compose 1.14.0 I get the following
docker run -v /home/dudarev/compose/:/compose/ --privileged docker:dind /compose/docker-compose
/usr/local/bin/dockerd-entrypoint.sh: exec: line 21: /compose/docker-compose: not found
我错过了什么吗?
推荐答案
在执行docker run之前将docker-compose安装添加到Dockerfile中。
Add docker-compose installation to your Dockerfile before executing docker run.
例如,如果您有Ubuntu Docker,则将其添加到 Dockerfile :
For example, if you have an Ubuntu docker, add to your Dockerfile:
RUN aptitude -y install docker-compose
RUN ln -s /usr/local/bin/docker-compose /compose/docker-compose
因为看起来像您的入口点在/ compose文件夹中查找docker compose,而docker-compose安装在/ usr /
Because it looks like if your entry-point looks up docker compose in /compose folder, while docker-compose is installed in /usr/local/bin by default.
RUN curl -L https://github.com/docker/compose/releases/download/1.20.0-rc2/docker-compose-`uname -s`-`uname -m` -o /compose/docker-compose
RUN chmod +x /compose/docker-compose
这篇关于docker在docker中的docker内部撰写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!