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

docker_registry_image fails to exclude files listed in .dockerignore #280

Closed
moritzheiber opened this issue Sep 2, 2021 · 5 comments
Closed
Labels
bug Something isn't working pinned r/registry_image

Comments

@moritzheiber
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and docker Provider) Version

terraform -v
Terraform v1.0.5
on linux_amd64

Provider version is 2.15.0.

Affected Resource(s)

  • docker_registry_image

Terraform Configuration Files

I've created a POC repository which allows for reproducing the bug: https://github.com/moritzheiber/terraform-docker-provider-dockerignore

Expected Behaviour

The files added to the .dockerignore file are not contained within the resulting image.

Actual Behaviour

The files added to the .dockerignore file are contained within the resulting image.

Steps to Reproduce

See the README.md in the POC repository.

References

Also, taking a look at the test for this particular functionality, the Dockerfile used for it doesn't have a broad instruction for adding files into the image, which means the ignored file cannot possible ever show up in the image itself, leading me to believe the test itself is not sufficient in order to verify the given functionality.

@mavogel mavogel added the bug Something isn't working label Sep 7, 2021
@mavogel mavogel added this to the v2.16.0 milestone Sep 7, 2021
@github-actions
Copy link

github-actions bot commented Nov 6, 2021

This issue is stale because it has been open 60 days with no activity.
Remove stale label or comment or this will be closed in 7 days.
If you don't want this issue to be closed, please set the label pinned.

@github-actions github-actions bot added the stale label Nov 6, 2021
@moritzheiber
Copy link
Author

Uhm, this issue has been marked as a target for 2.16.0, it shouldn’t even be marked as stale..?

@moritzheiber
Copy link
Author

@mavogel some help? 😅

@marcelmeulemans
Copy link
Contributor

The issue here is that absolute paths are passed to the excludes matcher. I would create a PR but not being proficient in go is preventing me from fixing the associated unit test. The unit test currently does not really check the ignore behaviour because the file being modified in the test here was not even copied to the image.

@mavogel
Copy link
Contributor

mavogel commented Nov 30, 2021

sure @moritzheiber feel free to help :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinned r/registry_image
Projects
None yet
Development

No branches or pull requests

5 participants