Skip to content

Documentation for ARG IMAGE= in dockerfile manager #28916

Answered by rarkins
wwuck asked this question in Request Help
Discussion options

You must be logged in to vote

Code:

const argRegex = regEx(
'^[ \\t]*ARG(?:' +
escapeChar +
'[ \\t]*\\r?\\n| |\\t|#.*?\\r?\\n)+(?<name>\\w+)[ =](?<value>\\S*)',
'im',
);
const argMatch = argRegex.exec(instruction);
if (argMatch?.groups?.name) {
argsLines[argMatch.groups.name] = [lineNumberInstrStart, lineNumber];
let argMatchValue = argMatch.groups?.value;
if (
argMatchValue.charAt(0) === '"' &&
argMatchValue.charAt(argMatchValue.length - 1) === '"'
) {
argMatchValue = argMatchValue.slice(1, -1);
}
args[argMatch.groups.name] = argMatchValue ||

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wwuck
Comment options

@rarkins
Comment options

Answer selected by wwuck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants