How to run docker-compose on remote host?

前端 未结 6 1211
刺人心
刺人心 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:08

    From the compose documentation

    Compose CLI environment variables

    DOCKER_HOST

    Sets the URL of the docker daemon. As with the Docker client, defaults to unix:///var/run/docker.sock.

    so that we can do

    export DOCKER_HOST=tcp://192.168.1.2:2375
    docker-compose up
    

提交回复
热议问题