Open SetTrend opened 2 months ago
For the backslash case, it's the challenge of interpreting quotes. As a workaround, if you put double backslashes the issue should go away.
I'm not confident that your statement is correct.
In the first line of the Dockerfile
there is a parser directive # escape=`
. The Dockerfile reference claims that when using this directive, you don't need to escape backslashes.
I'm not confident that your statement is correct.
In the first line of the
Dockerfile
there is a parser directive# escape=`
. The Dockerfile reference claims that when using this directive, you don't need to escape backslashes.
@SetTrend Thank you for pointing that out. You are correct that it does seem that the parser directive is not just for newlines at the end of a line in the file but also for content within the line. Sorry about that.
The escape character is used both to escape characters in a line, and to escape a newline.
Perhaps you may want to follow this discussion on the Dockerfile
COPY
syntax first before beginning to solve this issue:
/docker/docs/issues/19922: Dockerfile COPY
instruction description is misleading
Perhaps you may want to follow this discussion on the
Dockerfile
COPY
syntax first before beginning to solve this issue:/docker/docs/issues/19922: Dockerfile
COPY
instruction description is misleading
Thanks for the pointer. This does sound vaguely familiar...
Synopsis
Although I correctly added a backslash to the destination of my
COPY
commands, the Dockerfile linter throws an error claiming that I didn't:Current Situation
The Dockerfile linter erroneously throws an error about a missing a trailing backslash although it has been provided.
Desired Situation
ARG
,ENV
variables) should be correctly parsed and interpreted.VS Code Docker Extension Version
v1.29.0
Dockerfile Example Using Variables
The same
Dockerfile
as above, this time using variables for destination: