Use fig and docker-machine to deploy remotely

I use docker-machine to easily create docker hosts on AWS.

Locally I use fig (or docker-compose) to start the various microservices associated with a service.

  • karma phantomjs not capturing in docker container
  • Docker build ubuntu:xenial issue
  • Run a Docker image as a command line utility in Windows?
  • Registrator not listening to docker events
  • when doing docker compose, is it possible to keep previous docker composition
  • lstate error: no such file or directory while building Docker from a custom image with Docker build command
  • Is it possible for fig to use the config variables set by the docker-machine command:

     docker-machine config host
    

    So when I do:

    fig up
    

    Fig creates the service on the host set by docker-machine and not the local one?

  • How to access a container from a Bluemix app?
  • Volume and data persistence
  • Performance and reliability when using multiple Docker containers VS standard Node cluster
  • Docker private registry issue
  • How to restart multiple containers in a docker swarm
  • unable to run web application on docker
  • One Solution collect form web for “Use fig and docker-machine to deploy remotely”

    I haven’t tried to do this with a remote host but I have it working with a vmwarefusion based machine. Because fig respects some of the DOCKER_ environment variables you can modify them to point to your docker host. Try something like this:

    $(docker-machine env host); docker-compose up
    

    Edited previous approach (referenced in comments):

    #!/bin/bash
    
    # modify path and host with output from > docker-machine config host
    DOCKER_CERT_PATH=~/.docker/machines/.client/
    DOCKER_HOST=tcp://172.16.124.216:2376
    DOCKER_TLS_VERIFY=1
    
    fig up
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.