JoTrdl / grunt-dock

A Grunt plugin to manage Docker
MIT License
12 stars 11 forks source link

Tasks not responsive #5

Open meetwudi opened 9 years ago

meetwudi commented 9 years ago

When I run any task like grunt dock:list, there is no result coming out. It seems like the plugin is not working.

My Gruntfile.js:

var fs = require('fs'),
    path = require('path'),
    utils = require('grunt-dock/lib/utils');

module.exports = function(grunt) {
  require('load-grunt-tasks')(grunt);

  var caPath   = path.resolve(utils.getUserHome(), '.boot2docker/certs/boot2docker-vm/', 'ca.pem'),
      certPath = path.resolve(utils.getUserHome(), '.boot2docker/certs/boot2docker-vm/', 'cert.pem'),
      keyPath  = path.resolve(utils.getUserHome(), '.boot2docker/certs/boot2docker-vm/', 'key.pem');

  grunt.initConfig({
    dock: {
      options: {

        // Docker connection options
        // For this example, assume it is a Boot2Docker config.
        // By default, Boot2Docker only accepts secure connection.
        docker: {
          protocol: 'https',
          host: '192.168.59.99',
          port: '2376',

          ca: fs.readFileSync(caPath),
          cert: fs.readFileSync(certPath),
          key: fs.readFileSync(keyPath)
        },

        images: {
          // The 'simple' image
          'tjwudi/wudi-link': {
            // The Dockerfile to use
            dockerfile: './Dockerfile',

            // Options for dockerode
            options: {

              // When starting the container:
              // Bind the container port to the host (same port)
              // + 
              // Bind the './bundle' directory to the '/bundle' container one
              start:  {
                "PortBindings": { "3000/tcp": [ { "HostPort": "8080" } ] },
                "Binds":[__dirname + ":/src"]
              },

              // For the logs command, we want to display stdout
              logs: { stdout: true }
            }
          }
        }
      }
    }
  });

  require('grunt-dock/tasks/dock')(grunt);
};
JoTrdl commented 9 years ago

Sorry for the delay, I will have a look soon and come back