Start a docker machine using JavaScript

I’m actually facing a problem to start my machine by my JavaScript. I can stop the running machines without any problems but I can’t start.

The error is the next one :

  • Mattermost docker preview
  • Syntax error when adding SSH key in GitLab CI
  • Can't connect to ElasticSearch Docker cluster which run on local virtual machine using Java API
  • Automatic building and installing Packages from AUR for Arch Linux inside Docker with yaourt and >makepkg-4.2.0
  • How do I set System Path in my dockerfile for a Windows Container?
  • How do symlinks in a host volume work in Docker containers?
  • /Users/swisscom_NG/Desktop/mgmt-docker-gui/node_modules/docker-machine/index.js:79
    W20170106-13:19:51.164(1)? (STDERR)         done()
    W20170106-13:19:51.164(1)? (STDERR)         ^
    W20170106-13:19:51.165(1)? (STDERR)
    W20170106-13:19:51.165(1)? (STDERR) TypeError: done is not a function
    

    The code executed is :

    'machine.start': function(name){
      Machine.start(name);
    }
    

    And Machine is defined like this:

    import Machine from 'docker-machine';
    

    The error is because it thinks that the machine is running but if I look into Docker I can see :
    enter image description here

    I’m using node-docker-machine

    Thank you for your help.

  • Does virtualenv serve a purpose (in production) when using docker?
  • Requests to docker containers failing on chrome for OSX
  • How do I run a docker instance from a DockerFile?
  • Can't run sample express app in node container on Windows
  • Gitlab, docker and sendmail ports
  • golang docker private github repository
  • One Solution collect form web for “Start a docker machine using JavaScript”

    If you check the documentation of docker-machine you need to pass a done function to get the callback when docker-machine finish the start event. so just change your code as this:

    Machine.start(name, function(){ console.log('Docker Started') });
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.