Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Trim relative path indicators from Dockerfile path #1203

Merged

Conversation

HofmeisterAn
Copy link
Collaborator

@HofmeisterAn HofmeisterAn commented Jun 22, 2024

What does this PR do?

The pull request removes the relative path indicators from the Dockerfile path in the WithDockerfile(string) image builder API.

Why is it important?

This change is necessary to prevent issues when a developer passes a relative path to the API, such as ./Dockerfile. If the Dockerfile path starts with a relative path indicator, the .dockerignore negate pattern that makes sure the Dockerfile is always included in the tarball might not work correct. This can result in the Dockerfile not being included. Building the image fails with the following or a similar error:

Cannot locate specified Dockerfile: ./Dockerfile

Trimming the relative path indicators prevents a follow-up issue. If the path contains relative path indicators, setting the ImageBuildParameters.Dockerfile property causes the build to fail as well.

Related issues

@HofmeisterAn HofmeisterAn added the bug Something isn't working label Jun 22, 2024
Copy link

netlify bot commented Jun 22, 2024

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit 99abf20
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/66766fe5cd8f44000870e3ce
😎 Deploy Preview https://deploy-preview-1203--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 site configuration.

@HofmeisterAn HofmeisterAn merged commit a0f1f76 into develop Jun 22, 2024
14 checks passed
@HofmeisterAn HofmeisterAn deleted the bugfix/trim-relative-path-indicators-dockerfile branch June 22, 2024 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Unable to locate Dockerfile on v3.8.0
1 participant