microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.18k stars 508 forks source link

Linting error using docker/dockerfile:1.7-labs and COPY --exclude #4284

Closed joaomorenorf closed 1 month ago

joaomorenorf commented 2 months ago

I'm using docker/dockerfile:1.7-labs syntax to be able to use COPY --exclude, but the linter doesn't recognize it.

image

image

I tried to restart the IDE, but didn't worked.

I'm using: Visual Studio Code 1.88.0 Docker extension v1.29.0 Docker Desktop 4.28.0

bwateratmsft commented 2 months ago

@rcjsuen is this labs syntax stuff something we even want to support?

joaomorenorf commented 2 months ago

It's in the official documentation: https://docs.docker.com/reference/dockerfile/#copy---exclude The labs syntax add only two modifications https://docs.docker.com/build/dockerfile/release-notes/#labs

joaomorenorf commented 2 months ago

Is there a way of adding a custom rule to ignore this error?

rcjsuen commented 2 months ago

@rcjsuen is this labs syntax stuff something we even want to support?

I added support for this last month (https://github.com/rcjsuen/dockerfile-utils/issues/124) but I need to make a new release of the language server to include the update.

Is there a way of adding a custom rule to ignore this error?

You can try putting # dockerfile-utils: ignore before the error and it should ignore it.

rcjsuen commented 1 month ago

I've published a new 0.12.0 to npm that should fix this issue.