()
| 34 | } |
| 35 | |
| 36 | function 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 |
no test coverage detected
searching dependent graphs…