问题描述
我在本地撰写文件.如何在带有 DOCKER_HOST =< some ip>
的远程主机(如 docker-compose up -d
)上运行容器捆绑?
I have compose file locally. How to run bundle of containers on remote host like docker-compose up -d
with DOCKER_HOST=<some ip>
?
推荐答案
如果不需要在本地计算机上运行docker容器,但仍在同一台远程计算机上,则可以在docker设置中进行更改.
If you don't need to run docker container on your local machine, but still on the same remote machine, you can change this in your docker setting.
在本地计算机上:您可以使用-H参数控制远程主机
On the local machine:You can control remote host with -H parameter
docker -H tcp://remote:2375 pull ubuntu
要将其与docker-compose一起使用,应在/etc/default/docker
To use it with docker-compose, you should add this parameter in /etc/default/docker
在远程计算机上
您应该更改来自外部地址的监听,而不仅限于unix套接字.
You should change listen from external adress and not only unix socket.
请参见将Docker绑定到另一个主机/端口或Unix套接字以获取更多详细信息.
See Bind Docker to another host/port or a Unix socket for more details.
如果需要在多个远程主机上运行容器,则应配置Docker Swarm
If you need to run container on multiple remote hoste, you should configure Docker Swarm
这篇关于如何在远程主机上运行docker-compose?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!