Skip to content
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 description is misleading #19922

Open
1 task done
SetTrend opened this issue Apr 30, 2024 · 0 comments
Open
1 task done

Dockerfile COPY instruction description is misleading #19922

SetTrend opened this issue Apr 30, 2024 · 0 comments
Labels
status/triage Needs triage

Comments

@SetTrend
Copy link

SetTrend commented Apr 30, 2024

Is this a docs issue?

  • My issue is about the documentation content or website

Type of issue

Information is incorrect

Description

At this time, the documentation on the Dockerfile COPY command reads:

COPY has two forms. The latter form is required for paths containing whitespace.

[COPY](https://docs.docker.com/reference/dockerfile/#copy) [OPTIONS] <src> ... <dest>
[COPY](https://docs.docker.com/reference/dockerfile/#copy) [OPTIONS] ["<src>", ... "<dest>"]

This information is wrong, incomprehensive and misleading.

There are actually three (not two) different forms of the COPY command, and one is behaving different from the others:

COPY has a plethora of forms:

[COPY](https://docs.docker.com/reference/dockerfile/#copy) [OPTIONS] <src> ... <dest>

The following forms are required for paths containing whitespace:

[COPY](https://docs.docker.com/reference/dockerfile/#copy) [OPTIONS] "<src>" ... "<dest>"
[COPY](https://docs.docker.com/reference/dockerfile/#copy) [OPTIONS] ["<src>", ... "<dest>"]

NB: The escape parser directive character is not adhered to when using the last form, which is a JSON array.


See: moby/moby/issues/47776: Dockerfile COPY instruction doesn't adhere to parser directive "escape"

Location

https://docs.docker.com/reference/dockerfile/#copy

Suggestion

Please amend the text as described above.

You may want to wait for the other issue to be resolved before addding the "NB: The escape parser directive character is not adhered to when using the last form, which is a JSON array." to each Dockerfile instruction accepting a JSON array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triage Needs triage
Projects
None yet
Development

No branches or pull requests

1 participant