dockerfile-parser-rs icon indicating copy to clipboard operation
dockerfile-parser-rs copied to clipboard

Escaped spaces in EnvVar value fails to parse

Open dsherret opened this issue 4 years ago • 0 comments

The following fails to parse:

ENV MY_DOG=Rex\ The\ Dog
could not parse Dockerfile:  --> 1:17
  |
1 | ENV MY_DOG=Rex\ The\ Dog␊
  |                 ^---
  |
  = expected EOI or env_pair

Note the documentation mentions that spaces can be escaped with backslashes (example above is from the documentation):

The value will be interpreted for other environment variables, so quote characters will be removed if they are not escaped. Like command line parsing, quotes and backslashes can be used to include spaces within values.

https://docs.docker.com/engine/reference/builder/#env

dsherret avatar Oct 09 '21 17:10 dsherret