mirror of https://github.com/docker/docs.git
Merge pull request #652 from kitematic/fix-copy-compose
Fix bug where docker-compose binary would not be copied
This commit is contained in:
commit
1919f4beeb
|
|
@ -16,5 +16,8 @@ module.exports = {
|
||||||
},
|
},
|
||||||
dockerMachine: function () {
|
dockerMachine: function () {
|
||||||
return path.join(this.resourceDir(), 'docker-machine' + util.binsEnding());
|
return path.join(this.resourceDir(), 'docker-machine' + util.binsEnding());
|
||||||
|
},
|
||||||
|
dockerCompose: function () {
|
||||||
|
return path.join(this.resourceDir(), 'docker-compose' + util.binsEnding());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,10 @@ var SetupUtil = {
|
||||||
shouldUpdateBinaries: function () {
|
shouldUpdateBinaries: function () {
|
||||||
return !fs.existsSync(util.dockerBinPath()) ||
|
return !fs.existsSync(util.dockerBinPath()) ||
|
||||||
!fs.existsSync(util.dockerMachineBinPath()) ||
|
!fs.existsSync(util.dockerMachineBinPath()) ||
|
||||||
|
!fs.existsSync(util.dockerComposeBinPath()) ||
|
||||||
|
this.checksum(util.dockerBinPath()) !== this.checksum(resources.docker()) ||
|
||||||
this.checksum(util.dockerMachineBinPath()) !== this.checksum(resources.dockerMachine()) ||
|
this.checksum(util.dockerMachineBinPath()) !== this.checksum(resources.dockerMachine()) ||
|
||||||
this.checksum(util.dockerBinPath()) !== this.checksum(resources.docker());
|
this.checksum(util.dockerComposeBinPath()) !== this.checksum(resources.dockerCompose());
|
||||||
},
|
},
|
||||||
copycmd: function (src, dest) {
|
copycmd: function (src, dest) {
|
||||||
return ['rm', '-f', dest, '&&', 'cp', src, dest];
|
return ['rm', '-f', dest, '&&', 'cp', src, dest];
|
||||||
|
|
@ -40,6 +42,8 @@ var SetupUtil = {
|
||||||
cmd.push.apply(cmd, this.copycmd(util.escapePath(resources.dockerMachine()), '/usr/local/bin/docker-machine'));
|
cmd.push.apply(cmd, this.copycmd(util.escapePath(resources.dockerMachine()), '/usr/local/bin/docker-machine'));
|
||||||
cmd.push('&&');
|
cmd.push('&&');
|
||||||
cmd.push.apply(cmd, this.copycmd(util.escapePath(resources.docker()), '/usr/local/bin/docker'));
|
cmd.push.apply(cmd, this.copycmd(util.escapePath(resources.docker()), '/usr/local/bin/docker'));
|
||||||
|
cmd.push('&&');
|
||||||
|
cmd.push.apply(cmd, this.copycmd(util.escapePath(resources.dockerCompose()), '/usr/local/bin/docker-compose'));
|
||||||
return cmd.join(' ');
|
return cmd.join(' ');
|
||||||
},
|
},
|
||||||
fixBinariesCmd: function () {
|
fixBinariesCmd: function () {
|
||||||
|
|
@ -49,6 +53,8 @@ var SetupUtil = {
|
||||||
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker-machine')]);
|
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker-machine')]);
|
||||||
cmd.push('&&');
|
cmd.push('&&');
|
||||||
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker')]);
|
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker')]);
|
||||||
|
cmd.push('&&');
|
||||||
|
cmd.push.apply(cmd, ['chown', `${process.getuid()}:${80}`, path.join('/usr/local/bin', 'docker-compose')]);
|
||||||
return cmd.join(' ');
|
return cmd.join(' ');
|
||||||
},
|
},
|
||||||
installVirtualBoxCmd: function () {
|
installVirtualBoxCmd: function () {
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,9 @@ module.exports = {
|
||||||
dockerMachineBinPath: function () {
|
dockerMachineBinPath: function () {
|
||||||
return path.join(this.binsPath(), 'docker-machine' + this.binsEnding());
|
return path.join(this.binsPath(), 'docker-machine' + this.binsEnding());
|
||||||
},
|
},
|
||||||
|
dockerComposeBinPath: function () {
|
||||||
|
return path.join(this.binsPath(), 'docker-compose' + this.binsEnding());
|
||||||
|
},
|
||||||
escapePath: function (str) {
|
escapePath: function (str) {
|
||||||
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue