MCPcopy
hub / github.com/Unitech/pm2 / checkDockerSetup

Function checkDockerSetup

lib/API/Containerizer.js:36–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34}
35
36function checkDockerSetup() {
37 return new Promise(function(resolve, reject) {
38 exec("docker version -f '{{.Client.Version}}'", function(err, stdout, stderr) {
39 if (err) {
40 console.error(chalk.red.bold('[Docker access] Error while trying to use docker command'));
41 if (err.message && err.message.indexOf('Cannot connect to the Docker') > -1) {
42 console.log();
43 console.log(chalk.blue.bold('[Solution] Setup Docker to be able to be used without sudo rights:'));
44 console.log(chalk.bold('$ sudo groupadd docker'));
45 console.log(chalk.bold('$ sudo usermod -aG docker $USER'));
46 console.log(chalk.bold('Then LOGOUT and LOGIN your Linux session'));
47 console.log('Read more: http://bit.ly/29JGdCE');
48 }
49 return reject(err);
50 }
51 return resolve();
52 });
53 });
54}
55
56/**
57 * Switch Dockerfile mode

Callers 1

Containerizer.jsFile · 0.85

Calls 2

indexOfMethod · 0.80
execFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…