How to run docker-compose on remote host?

前端 未结 6 1313
刺人心
刺人心 2021-01-31 16:53

I have compose file locally. How to run bundle of containers on remote host like docker-compose up -d with DOCKER_HOST=?

6条回答
  •  情书的邮戳
    2021-01-31 17:11

    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.

    On the local machine: You can control remote host with -H parameter

    docker -H tcp://remote:2375 pull ubuntu
    

    To use it with docker-compose, you should add this parameter in /etc/default/docker

    On the remote machine

    You should change listen from external adress and not only unix socket.

    See Bind Docker to another host/port or a Unix socket for more details.

    If you need to run container on multiple remote hoste, you should configure Docker Swarm

提交回复
热议问题