How to use the dockerode.default function in dockerode

To help you get started, we’ve selected a few dockerode examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zotoio / github-task-manager / src / executors / ExecutorDocker.js View on Github external
let message = `image '${image}' is not whitelisted.`;
            log.error(message);
            let resultSummary = {
                passed: false,
                url: 'https://github.com/apocas/dockerode',
                message: message
            };

            task.results = resultSummary;

            return Promise.reject(task);
        }

        log.info(`Starting local docker container '${image}' to run: ${command}`);

        let docker = new Docker();
        let that = this;

        return this.pullImage(docker, image)
            .then(() => {
                return docker.createContainer({
                    Image: image,
                    Cmd: command,
                    Env: this.formatEnv(env)
                });
            })

            .then(container => {
                return container.start();
            })

            .then(container => {