Merge 44a50c06ac
into a3071585aa
This commit is contained in:
commit
507eb11ad8
@ -459,11 +459,33 @@ function profileDockerSetup(opts, cb) {
|
||||
if (!arg.dockerVersion) {
|
||||
setup.env.DOCKER_CLIENT_TIMEOUT = '300';
|
||||
setup.env.COMPOSE_HTTP_TIMEOUT = '300';
|
||||
} else if (semver.gte(arg.dockerVersion, '1.9.0')) {
|
||||
} else {
|
||||
|
||||
/*
|
||||
* We now need to parse version numbers differently since the
|
||||
* introduction of Docker CE and EE. semver won't like them.
|
||||
*/
|
||||
var versionNumberExp = /(?:\d+\.){2}\d+/;
|
||||
var versionNumber = versionNumberExp.exec(arg.dockerVersion)[0];
|
||||
|
||||
/*
|
||||
* semver also doesn't seem to like versions like `17.03.0'.
|
||||
* The prefixing 0 in the minor number of the exemple seems
|
||||
* to hurt it. Let's parse them back to numbers with no
|
||||
* prefixing `0's.
|
||||
*/
|
||||
|
||||
versionNumber = versionNumber
|
||||
.split('.')
|
||||
.map(function (strnum) { return parseInt(strnum, 10); })
|
||||
.join('.');
|
||||
|
||||
if (semver.gte(versionNumber, '1.9.0')) {
|
||||
setup.env.COMPOSE_HTTP_TIMEOUT = '300';
|
||||
} else {
|
||||
setup.env.DOCKER_CLIENT_TIMEOUT = '300';
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFile(setupJson,
|
||||
JSON.stringify(setup, null, 4) + '\n',
|
||||
|
Reference in New Issue
Block a user