charliecloud icon indicating copy to clipboard operation
charliecloud copied to clipboard

`LABEL` does not allow multi-line value declarations in Dockerfiles

Open BenStormer opened this issue 2 years ago • 2 comments

Presently, the LABEL command in Dockerfiles does not allow users to declare a multi-line value for an associated label, e.g.: LABEL label="foo bar"

is allowed, but

LABEL label2="foo \ bar"

causes an error.

Allowing Dockerfiles to use multi-line values for an associated label agrees with Docker's implementation of LABEL shown here: https://docs.docker.com/engine/reference/builder/#label

Currently, the grammar Charliecloud uses to interpret LABEL commands makes use of Lark's default definition of an "escaped string", and this regex likely is where this issue can be fixed. A Stack Overflow post explaining the "escaped string" regex can be found here: https://stackoverflow.com/questions/61372172/lark-grammar-how-does-the-escaped-string-regex-work

BenStormer avatar Dec 14 '22 21:12 BenStormer

See also #846.

reidpr avatar Dec 16 '22 23:12 reidpr

See also #1068.

reidpr avatar Dec 16 '22 23:12 reidpr