{"id":15928317,"url":"https://github.com/moritzheiber/terraform-docker-provider-dockerignore","last_synced_at":"2026-05-09T06:03:37.423Z","repository":{"id":149805314,"uuid":"402318863","full_name":"moritzheiber/terraform-docker-provider-dockerignore","owner":"moritzheiber","description":null,"archived":false,"fork":false,"pushed_at":"2021-09-02T07:58:03.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-03T17:51:25.665Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HCL","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moritzheiber.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-02T06:46:17.000Z","updated_at":"2021-09-02T07:58:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"00c38d1a-9b89-4de5-bb17-ba59e3fe1de9","html_url":"https://github.com/moritzheiber/terraform-docker-provider-dockerignore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moritzheiber/terraform-docker-provider-dockerignore","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moritzheiber%2Fterraform-docker-provider-dockerignore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moritzheiber%2Fterraform-docker-provider-dockerignore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moritzheiber%2Fterraform-docker-provider-dockerignore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moritzheiber%2Fterraform-docker-provider-dockerignore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moritzheiber","download_url":"https://codeload.github.com/moritzheiber/terraform-docker-provider-dockerignore/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moritzheiber%2Fterraform-docker-provider-dockerignore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32809148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-06T23:40:20.647Z","updated_at":"2026-05-09T06:03:37.408Z","avatar_url":"https://github.com/moritzheiber.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- BEGIN_TF_DOCS --\u003e\n# Reproducing a bug in the Terraform Docker provider\n\nThe Terraform Docker provider added the ability to interpret a `.dockerignore` file recently, however, there appears to be a bug in it which \"ignores\" the ignored files in it and adds them to an image anyway /o\\.\n\nThis repository should aid in reproducing said bug.\n\n## Versions\n\n- Terraform 1.0.5\n- Provider version 2.15.0\n- Docker 20.10.8, build 3967b7d\n- Ubuntu Linux 21.04\n\n## Setup\n\nYou need:\n\n- a [Github Access Token which allows for accessing the GitHub Container Registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry) (`ghcr.io`)\n- a valid GitHub username\n- a valid GitHub repository to push to. This module assumes it carries the same name as this very repository.\n\n## Reproducing the bug\n\nFork this repository and copy the file `terraform/terraform.tfvars.example` to `terraform/terraform.tfvars` and fill it with content. Alternatively, you can also specify the required variables (see below) manually during the run.\n\nTo build the image, run:\n\n```console\n$ terraform -chdir=terraform init\n$ terraform -chdir=terraform apply\n```\n\nYou should then have a copy of the pushed image stored locally on your machine.\n\nThe `.dockerignore` file contains a ton of files (e.g. the `Dockerfile` itself, the `terraform` directory, to name a few) that shouldn't be present inside the image:\n\n```console\n$ cat .dockerignore\nsome_ignored_file.txt\nterraform*\nDockerfile\ndocs\nREADME.md\n```\n\nHowever, if you peak inside, they are all there:\n\n```console\n$ docker run -ti --rm $(terraform -chdir=terraform output -raw image_reference) ls -la\ntotal 72\n----------    1 root     root          4128 Jan  1  1970 README.md\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 bin\ndrwxr-xr-x    5 root     root           360 Sep  2 07:47 dev\nd---------    2 root     root          4096 Jan  1  1970 docs\ndrwxr-xr-x    1 root     root          4096 Sep  2 07:47 etc\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 home\ndrwxr-xr-x    7 root     root          4096 Aug  5 12:25 lib\ndrwxr-xr-x    5 root     root          4096 Aug  5 12:25 media\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 mnt\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 opt\ndr-xr-xr-x  428 root     root             0 Sep  2 07:47 proc\ndrwx------    2 root     root          4096 Aug  5 12:25 root\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 run\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 sbin\n----------    1 root     root             0 Jan  1  1970 some_file.txt\n----------    1 root     root             0 Jan  1  1970 some_ignored_file.txt\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 srv\ndr-xr-xr-x   13 root     root             0 Sep  2 07:47 sys\nd---------    3 root     root          4096 Jan  1  1970 terraform\ndrwxrwxrwt    2 root     root          4096 Aug  5 12:25 tmp\ndrwxr-xr-x    7 root     root          4096 Aug  5 12:25 usr\ndrwxr-xr-x   12 root     root          4096 Aug  5 12:25 var\n```\n\n*Note: the permissions are also horrible wrong, but that's for another bug to consider*\n\nYou can verify that the `.dockerignore` file is being properly observed when build the container manually and inspecting its content:\n\n```console\n$ docker build -t test-container .\n[...]\n$ docker run --rm -ti test-container ls -l\ntotal 56\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 bin\ndrwxr-xr-x    5 root     root           360 Sep  2 07:49 dev\ndrwxr-xr-x    1 root     root          4096 Sep  2 07:49 etc\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 home\ndrwxr-xr-x    7 root     root          4096 Aug  5 12:25 lib\ndrwxr-xr-x    5 root     root          4096 Aug  5 12:25 media\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 mnt\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 opt\ndr-xr-xr-x  425 root     root             0 Sep  2 07:49 proc\ndrwx------    2 root     root          4096 Aug  5 12:25 root\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 run\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 sbin\n-rw-rw-r--    1 root     root             0 Sep  2 06:43 some_file.txt\ndrwxr-xr-x    2 root     root          4096 Aug  5 12:25 srv\ndr-xr-xr-x   13 root     root             0 Sep  2 07:49 sys\ndrwxrwxrwt    2 root     root          4096 Aug  5 12:25 tmp\ndrwxr-xr-x    7 root     root          4096 Aug  5 12:25 usr\ndrwxr-xr-x   12 root     root          4096 Aug  5 12:25 var\n```\n\n---\n\n## Requirements\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"requirement_docker\"\u003e\u003c/a\u003e [docker](#requirement\\_docker) | 2.15.0 |\n\n## Providers\n\n| Name | Version |\n|------|---------|\n| \u003ca name=\"provider_docker\"\u003e\u003c/a\u003e [docker](#provider\\_docker) | 2.15.0 |\n\n## Modules\n\nNo modules.\n\n## Resources\n\n| Name | Type |\n|------|------|\n| [docker_registry_image.image](https://registry.terraform.io/providers/kreuzwerker/docker/2.15.0/docs/resources/registry_image) | resource |\n\n## Inputs\n\n| Name | Description | Type | Default | Required |\n|------|-------------|------|---------|:--------:|\n| \u003ca name=\"input_github_access_token\"\u003e\u003c/a\u003e [github\\_access\\_token](#input\\_github\\_access\\_token) | n/a | `string` | n/a | yes |\n| \u003ca name=\"input_registry_url\"\u003e\u003c/a\u003e [registry\\_url](#input\\_registry\\_url) | n/a | `string` | n/a | yes |\n| \u003ca name=\"input_username\"\u003e\u003c/a\u003e [username](#input\\_username) | n/a | `string` | n/a | yes |\n\n## Outputs\n\n| Name | Description |\n|------|-------------|\n| \u003ca name=\"output_image_reference\"\u003e\u003c/a\u003e [image\\_reference](#output\\_image\\_reference) | n/a |\n\u003c!-- END_TF_DOCS --\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoritzheiber%2Fterraform-docker-provider-dockerignore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoritzheiber%2Fterraform-docker-provider-dockerignore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoritzheiber%2Fterraform-docker-provider-dockerignore/lists"}