microsoft / microsoft/vscode-containers

Dockerfile Linter doesn't recognize directory destination in COPY command

Open
#133 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

language-server
Dominant language
TypeScript
Stars
139
Forks
87
Avg merge
9h 15m
Merged PRs (30d)
9

Description

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:

Dockerfile linter error

Current Situation

The Dockerfile linter erroneously throws an error about a missing a trailing backslash although it has been provided.

Desired Situation

  1. A trailing backslash should only be required for the destination path if the source is not a single file.
    (For paths containing spaces, the array syntax is mandatory.)
  2. A trailing backslash in the destination path portion of the command should correctly be recognized.
  3. The use of variables (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:

Dockerfile example using variables

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Dockerfile linter in the VS Code Containers extension and reproduce the reported COPY cases, including directory destinations, trailing backslashes, and ARG or ENV variables. Done means the linter distinguishes single-file and multi-source destinations and correctly recognizes destination backslashes and variable-based paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, dockerfile
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.