lib/docker.js
function startContainer(args, hidePorts) {

    const cmd = ['docker', 'run', '--name', name, '--rm'];

    // add the extra args as well
    if (args && Array.isArray(args)) {
        Array.prototype.push.apply(cmd, args);
    }

    if (!hidePorts) {
        // list all of the ports defined in the config file
        config.services.forEach((srv) => {
            srv.conf = srv.conf || {};
            srv.conf.port = srv.conf.port || 8888;
            cmd.push('-p', `${srv.conf.port}:${srv.conf.port}`);
        });
    }

    // append the image name to create a container from
    cmd.push(imgName);

    // ok, start the container
    return promisedSpawn(cmd, { useErrHandler: true });

}
function startContainer(args, hidePorts) {

    const cmd = ['docker', 'run', '--name', name, '--rm'];

    // add the extra args as well
    if (args && Array.isArray(args)) {
        Array.prototype.push.apply(cmd, args);
    }

    if (!hidePorts) {
        // list all of the ports defined in the config file
        config.services.forEach((srv) => {
            srv.conf = srv.conf || {};
            srv.conf.port = srv.conf.port || 8888;
            cmd.push('-p', `${srv.conf.port}:${srv.conf.port}`);
        });
    }

    // append the image name to create a container from
    cmd.push(imgName);

    // ok, start the container
    return promisedSpawn(cmd, { useErrHandler: true });

}
function startContainer ( args , hidePorts ) { const cmd = [ 'docker' , 'run' , '--name' , name , '--rm' ] ; // add the extra args as well if ( args && Array . isArray ( args ) ) { Array . prototype . push . apply ( cmd , args ) ; } if ( ! hidePorts ) { // list all of the ports defined in the config file config . services . forEach ( ( srv ) => { srv . conf = srv . conf || { } ; srv . conf . port = srv . conf . port || 8888 ; cmd . push ( '-p' , ` ${ srv . conf . port } ${ srv . conf . port } ` ) ; } ) ; } // append the image name to create a container from cmd . push ( imgName ) ; // ok, start the container return promisedSpawn ( cmd , { useErrHandler : true } ) ; }
Starts the container and returns once it has finished executing
@param {Array} args the array of extra parameters to pass, optional
@param {boolean} hidePorts whether to keep the ports hidden inside the container, optional
@return {Promise} the promise starting the container
Starts the container and returns once it has finished executing