New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dockerfile COPY instruction doesn't adhere to parser directive "escape" #47776
Comments
I'm not on a Windows machine myself (but could ask someone to try); I wonder here if it's failing to parse the JSON ( COPY [ "\*.*", "C:\Temp\" ] |
I just tested it. You are right: When omitting the brackets the script is working:
Yet, the problem still remains: At this time, the documentation on
If all the corner cases would need to be documented, the documentation would read like:
I propose to have the string dockerFile = ReadDockerfile()
char escape = /#\s*escape\s*=\s*(.+)/.match(dockerFile)
if (escape != '' && escape != '\\') dockerFile = dockerFile.Replace('\\', '\\\\').Replace(escape, '\\') Otherwise, the |
Description
According to Dockerfile reference documentation on
escape
parser directive:However, this doesn't work.
According to Go's
filepath.Match()
documentation:So, escaping is also not performed in a
COPY
command.Reproduce
Dockerfile
Expected behavior
The above Dockerfile build should flawlessly copy the whole context to the Windows container's
C:\Temp\
directory.Actual behavior
The
COPY
instruction fails.docker version
Client: Cloud integration: v1.0.35+desktop.13 Version: 26.0.0 API version: 1.45 Go version: go1.21.8 Git commit: 2ae903e Built: Wed Mar 20 15:18:56 2024 OS/Arch: windows/amd64 Context: default Server: Docker Desktop 4.29.0 (145265) Engine: Version: 26.0.0 API version: 1.45 (minimum version 1.24) Go version: go1.21.8 Git commit: 8b79278 Built: Wed Mar 20 15:17:49 2024 OS/Arch: windows/amd64 Experimental: false
docker info
The text was updated successfully, but these errors were encountered: