Skip to content

[Request]: container build should support Dockerfile-specific ignores. #1169

@jglogan

Description

@jglogan

Feature or enhancement request details

When searching for ignore files, container build should follow this order:

  • Use the file that has the same pathname as the Dockerfile, with the .dockerignore suffix, if it exists.
  • Use the file named .dockerignore in the build context directory, if it exists.

The attached archive runs a set of tests to check conformance. The results for colima vs container are shown in the discussion.

Tests:

  • Updated 2026-02-25 to include test that ensures app.Dockerfile.dockerignore gets used for app.Dockerfile instead of Dockerfile.dockerignore in the same directory, and same test when the Dockerfile and ignore files exist outside the context root.

20260205-dockerignore-paths.tgz

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

builderIssues and features associated with container image building

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions