Skip to content

Conversation

@HofmeisterAn
Copy link
Collaborator

What does this PR do?

This PR adds WithContextDirectory(string) to ImageFromDockerfileBuilder, letting developers specify the Docker build context directory. Previously, Testcontainers for .NET required the Dockerfile and .dockerignore to be inside the build context, which isn't always necessary/practical. The Docker CLI allows specifying a separate build context for a Dockerfile.

For backward compatibility, developers still need to specify the Dockerfile directory and name. We may refactor this in a follow-up PR. If no build context is specified, Testcontainers for .NET defaults to using the Dockerfile directory as the build context.

Additionally, this PR adds support for Dockerfile-specific ignore files. If such a file exists in the Dockerfile directory, it will be used instead of .dockerignore.

Why is it important?

-

Related issues

@HofmeisterAn HofmeisterAn added the enhancement New feature or request label Sep 27, 2025
@netlify
Copy link

netlify bot commented Sep 27, 2025

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 04a2d3c
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-dotnet/deploys/68d7b830e72b2f000825cbb5
😎 Deploy Preview https://deploy-preview-1536--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@HofmeisterAn HofmeisterAn merged commit 410d2c8 into develop Sep 27, 2025
137 checks passed
@HofmeisterAn HofmeisterAn deleted the feature/support-image-build-context branch September 27, 2025 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants