lib/container.js
function needBuild(mode, system, cdef, out, cb) {
    // TODO handle authentication and HTTPS registries
    // also handle other registries than docker-registry-container

    var cmds = commands(os.platform());
    var tag = cmds.generateTag(config, system, cdef);
    var baseUrl = 'http://' + config.registry + '/v1/repositories';
    var url = tag.replace(config.registry,
                          baseUrl) + '/tags';

    request({ url: url, json: true }, function(err, res, body) {
      if (err) { return cb(err); }

      // return the missing definition, or null
      cb(null, Object.keys(body).length === 0 ? cdef : null);
    });
  }
function needBuild(mode, system, cdef, out, cb) {
    // TODO handle authentication and HTTPS registries
    // also handle other registries than docker-registry-container

    var cmds = commands(os.platform());
    var tag = cmds.generateTag(config, system, cdef);
    var baseUrl = 'http://' + config.registry + '/v1/repositories';
    var url = tag.replace(config.registry,
                          baseUrl) + '/tags';

    request({ url: url, json: true }, function(err, res, body) {
      if (err) { return cb(err); }

      // return the missing definition, or null
      cb(null, Object.keys(body).length === 0 ? cdef : null);
    });
  }
function needBuild ( mode , system , cdef , out , cb ) { // TODO handle authentication and HTTPS registries // also handle other registries than docker-registry-container var cmds = commands ( os . platform ( ) ) ; var tag = cmds . generateTag ( config , system , cdef ) ; var baseUrl = 'http://' + config . registry + '/v1/repositories' ; var url = tag . replace ( config . registry , baseUrl ) + '/tags' ; request ( { url : url , json : true } , function ( err , res , body ) { if ( err ) { return cb ( err ) ; } // return the missing definition, or null cb ( null , Object . keys ( body ) . length === 0 ? cdef : null ) ; } ) ; }
Check if the container needs a build

system - the system definition
cdef - contianer definition block
out - ouput stream
cb - complete callback
Check if the container needs a build