mirror of https://github.com/docker/docs.git
Fix bug where docker-compose binary would not be coped on Install Docker Commands
This commit is contained in:
parent
fb60c7249f
commit
f354be70df
|
|
@ -16,5 +16,8 @@ module.exports = {
|
|||
},
|
||||
dockerMachine: function () {
|
||||
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 () {
|
||||
return !fs.existsSync(util.dockerBinPath()) ||
|
||||
!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.dockerBinPath()) !== this.checksum(resources.docker());
|
||||
this.checksum(util.dockerComposeBinPath()) !== this.checksum(resources.dockerCompose());
|
||||
},
|
||||
copycmd: function (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('&&');
|
||||
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(' ');
|
||||
},
|
||||
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('&&');
|
||||
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(' ');
|
||||
},
|
||||
installVirtualBoxCmd: function () {
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ module.exports = {
|
|||
dockerMachineBinPath: function () {
|
||||
return path.join(this.binsPath(), 'docker-machine' + this.binsEnding());
|
||||
},
|
||||
dockerComposeBinPath: function () {
|
||||
return path.join(this.binsPath(), 'docker-compose' + this.binsEnding());
|
||||
},
|
||||
escapePath: function (str) {
|
||||
return str.replace(/ /g, '\\ ').replace(/\(/g, '\\(').replace(/\)/g, '\\)');
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue