docker / docker/vscode-extension

CopyIgnoredFile warning when Dockerfile is in different directory than .dockerignore

Open
#238 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
59
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Description

I work with a monorepo that has several Dockerfiles for individual images, including one in the repository root. The root also contains a .dockerignore file that applies when the root directory is used as the docker build context. The other Dockerfiles are in subdirectories, and are built with those subdirectories as their context.

The Docker extension is giving me a CopyIgnoredFile in a Dockerfile stored in a subdirectory, even though that subdirectory does not have a .dockerignore file. In essence it seems to be using the .dockerignore file from the root repository to apply it to the subdirectory Dockerfile. This is not a problem when using docker build outside of vscode, only the warning is the problem here.

Visual Studio Code version

1.109.2
591199df409fbf59b4b52d5ad4ee0470152a9b31
x64

Installed extensions in Visual Studio Code

13xforever.language-x86-64-assembly@3.1.5
charliermarsh.ruff@2026.36.0
coderabbit.coderabbit-vscode@0.17.0
davidanson.vscode-markdownlint@0.61.1
dbaeumer.vscode-eslint@3.0.20
deque-systems.vscode-axe-linter@4.11.0
docker.docker@0.18.0
dorzey.vscode-sqlfluff@3.7.0
eamodio.gitlens@17.10.0
editorconfig.editorconfig@0.18.1
esbenp.prettier-vscode@12.3.0
exiasr.hadolint@1.1.2
github.copilot-chat@0.37.5
github.vscode-pull-request-github@0.128.0
longfish801.regexpoutline@1.1.0
mechatroner.rainbow-csv@3.24.1
ms-azuretools.vscode-containers@2.4.1
ms-azuretools.vscode-docker@2.0.0
ms-ossdata.vscode-pgsql@1.16.0
ms-python.black-formatter@2025.2.0
ms-python.debugpy@2025.18.0
ms-python.python@2026.0.0
ms-python.vscode-pylance@2025.10.4
ms-python.vscode-python-envs@1.16.0
ms-toolsai.jupyter@2025.9.1
ms-toolsai.jupyter-keymap@1.1.2
ms-toolsai.jupyter-renderers@1.3.0
ms-toolsai.vscode-jupyter-cell-tags@0.1.9
ms-toolsai.vscode-jupyter-slideshow@0.1.6
ms-vscode.cmake-tools@1.22.27
ms-vscode.cpptools@1.30.5
ms-vscode.cpptools-extension-pack@1.3.1
ms-vscode.cpptools-themes@2.0.0
ms-vscode.makefile-tools@0.12.17
netcorext.uuid-generator@0.0.5
orta.vscode-twoslash-queries@1.5.1
pdconsec.vscode-print@1.6.0
redhat.java@1.52.0
redhat.vscode-yaml@1.19.1
reteps.htmlmustache-lsp@0.0.15
sqlfluff.vscode-sqlfluff@4.0.0
supabase.postgrestools@1.4.0
tamasfe.even-better-toml@0.21.2
tobermory.es6-string-html@2.17.0
twxs.cmake@0.0.17
vadimcn.vscode-lldb@1.12.1
vitest.explorer@1.44.0
vscjava.vscode-gradle@3.17.2
vscjava.vscode-java-dependency@0.27.0
vscjava.vscode-java-pack@0.30.5
vscjava.vscode-maven@0.45.1

Additional info

The repo in question is this: https://github.com/PrairieLearn/PrairieLearn. In particular note that there are Dockerfiles in the root as well as in subdirectories of images, graders and workspaces. Only the root and two of the many images have .dockerignore files.

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

Reproduce the warning with the root Dockerfile, nested Dockerfiles under images, graders, or workspaces, and the available root or nested .dockerignore files in PrairieLearn. Compare the warning's ignore-file selection with the Docker build context; done when CopyIgnoredFile is evaluated only against the relevant context's .dockerignore.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
devops, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.