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

ImageFromDockerfileBuilder does not honour the .dockerignore file. #218

Closed
paulvanbladel opened this issue Feb 29, 2020 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@paulvanbladel
Copy link

Trying to build image from docker file but fails because process cannot access stuff in .vs folder etc.
Normally, when building image from commandline, the dockerignore file makes sure that all these files are excluded.

 await new ImageFromDockerfileBuilder()
                .WithDeleteIfExists(true)
                .WithDockerfileDirectory(@"D:\tfs\OutboxPattern")
                .WithName("Subsystem1.Api.Dockerfile")
                .Build();

This is the structure of my project, so the dockerfile is in the root while the project that is references in the dockerfile is in a sub folder.
Any ideas to get this working?
Thanks a lot.

image

@HofmeisterAn
Copy link
Collaborator

The implementation of DockerfileArchive does not support .dockerignore yet. It adds all files in DockerfileDirectory to the temporary created Dockerfile.tar. Either you move your Dockerfile, to another directory which contains only Docker image related files or you contribute and implement the .dockerignore feature to DockerfileArchive - that would be really nice!

It should be enough to filter the ignored directories and files here: https://github.com/HofmeisterAn/dotnet-testcontainers/blob/d6fbb00422e33e3187f29713e7283e7f31bc06e3/src/DotNet.Testcontainers/Images/Archives/DockerfileArchive.cs#L63-L65

@HofmeisterAn HofmeisterAn added the enhancement New feature or request label Feb 29, 2020
@HofmeisterAn HofmeisterAn added this to the 1.3.0 milestone Feb 29, 2020
@HofmeisterAn HofmeisterAn removed this from the 1.3.0 milestone Jul 3, 2020
@HofmeisterAn HofmeisterAn self-assigned this Jul 11, 2020
@HofmeisterAn HofmeisterAn added this to the 1.4.0 milestone Jul 11, 2020
HofmeisterAn added a commit that referenced this issue Jul 17, 2020
HofmeisterAn added a commit that referenced this issue Jul 17, 2020
@HofmeisterAn
Copy link
Collaborator

PR #269.

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
Development

No branches or pull requests

2 participants