Skip to content

"name.Dockerfile.dockerignore" no longer applies to dev container build #10460

Open

Description

  • VSCode Version: 1.95.1
  • Local OS Version: Pop!_OS 22.04
  • Remote OS Version: n/a
  • Remote Extension/Connection Type: Containers

When pointing VSCode at a named devcontainer Dockerfile, e.g dc.Dockerfile, then according to the Docker Spec, dc.Dockerfile.dockerignore should be used if it is found next to the named devcontainer dockerfile.

This used to work when I set up some dev containers around August/September. Now, it no longer does.

Repro is at https://github.com/jwhitaker-gridcog/devcontainers-repro , or briefly:

.devcontainer/devcontainer.json
{
	"name": "Default Linux Universal",
	"build": {
		"dockerfile": "dc.Dockerfile",
		"context": ".."
	}
}
.devcontainer/dc.Dockerfile
FROM mcr.microsoft.com/devcontainers/universal:2-linux

COPY . .

# testfile should be EXCLUDED from the docker context, as per dockerignore
RUN if [ -f testfile ]; then echo 'test failed'; exit 1; else echo 'all good'; fi
.devcontainer/dc.Dockerfile.dockerignore
testfile
testfile
# blank file

Expected behaviour: the image in the repro should build successfully, as testfile should be excluded from its build context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugcontainersIssue in vscode-remote containers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions