parent
c75fcfbd5e
commit
821b09daaf
20 changed files with 656 additions and 564 deletions
|
@ -42,24 +42,22 @@ angular.module('quay').factory('ImageMetadataService', ['UtilService', function(
|
|||
return null;
|
||||
}
|
||||
|
||||
return getDockerfileCommand(found.command);
|
||||
return metadataService.getDockerfileCommand(found.command);
|
||||
};
|
||||
|
||||
var getDockerfileCommand = function(command) {
|
||||
metadataService.getDockerfileCommand = function(command) {
|
||||
if (!command) { return ''; }
|
||||
command = command.join(' ').split(' ')
|
||||
|
||||
// ["/bin/sh", "-c", "#(nop) RUN foo"]
|
||||
var commandPrefix = '#(nop)';
|
||||
|
||||
if (command.length != 3) { return ''; }
|
||||
// ["/bin/sh", "-c", "#(nop)", "RUN", "foo"]
|
||||
if (command[0] != '/bin/sh' || command[1] != '-c') { return ''; }
|
||||
|
||||
var cmd = command[2];
|
||||
if (cmd.substring(0, commandPrefix.length) != commandPrefix) {
|
||||
return 'RUN ' + cmd;
|
||||
var commandPrefix = '#(nop)';
|
||||
if (command[2] != commandPrefix) {
|
||||
return 'RUN ' + command.slice(2).join(' ');
|
||||
}
|
||||
|
||||
return command[2].substr(commandPrefix.length + 1);
|
||||
return command.slice(3).join(' ');
|
||||
};
|
||||
|
||||
return metadataService;
|
||||
|
|
Reference in a new issue