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 :

  • How with Vagrant, ansible and docker to get Linux dev machine as close as possible to production
  • Is it best practice to daemonize a process within docker?
  • How to take container snapshots in docker
  • Can a docker image use executable from the host?
  • Docker `CMD a b c` VS `CMD [“a”, “b”, “c”]`
  • Docker: get/print ID of running container
  • /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){

    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.

  • I want to create a Docker image which contains Java and PostgreSQL. I just want to create an Image to reuse it from anywhere
  • Trouble getting AWS ecs-cli to pull from private docker repo
  • Custom Docker Repository URL for Artifactory and Jenkins
  • Docker install in user home
  • Docker echo environment variable
  • Docker how to change repository name or rename image?
  • 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.