Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ function parseNameVal(cmd) {
return false;
}
var parts = word.split('=');
cmd.args[parts[0]] = parts.slice(1).join('=');
cmd.args[parts[0]] = parts.slice(1).join('=').replace(/^"(.+?)"$/g, '$1');
}
}

Expand Down
1 change: 1 addition & 0 deletions test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ EXPOSE 80
EXPOSE 9989
VOLUME /srv/data2
RUN cd /srv/app && make build2
LABEL name="Some Name"
ENTRYPOINT node index.js
7 changes: 6 additions & 1 deletion test/test_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ tape('should parse a Dockerfile', function (t) {
var dockerFile = fs.readFileSync(dname + '/Dockerfile', 'utf8');
var commands = dockerfileParser.parse(dockerFile);

var numCommands = 15;
var numCommands = 16;
t.equal(commands.length, numCommands, 'Check number of commands');

var from = commands[0];
Expand All @@ -85,6 +85,11 @@ tape('should parse a Dockerfile', function (t) {
t.equal(env.args['VAR2'], '20', 'ENV VAR2 check');
t.equal(env.args['VAR3'], '30', 'ENV VAR3 check');

var label = commands[14];
t.equal(label.name, 'LABEL', '15th command is LABEL');
t.equal(Object.keys(label.args).length, 1, 'LABEL command has 1 key');
t.equal(label.args['name'], 'Some Name', 'LABEL name check');

t.equal(commands[numCommands-1].name, 'ENTRYPOINT',
'Last command should be ENTRYPOINT');

Expand Down