-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Correctly handle build files and context for docker_registry_ima…
…ge (#398) * tests: Add file_permission test which is failing for now. * tests: Add whitelist_dockerignore test which is failing for now. * fix: Various issues with docker_registry_image build process.
- Loading branch information
Showing
8 changed files
with
82 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
scripts/testing/docker_registry_image_file_permissions/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM debian:9.13-slim | ||
|
||
RUN groupadd -r testgroup && useradd -r testuser -G testgroup | ||
|
||
|
||
COPY --chown=testuser:testgroup . /testroot | ||
|
||
USER testuser | ||
|
||
WORKDIR /testroot | ||
RUN cat testfile |
1 change: 1 addition & 0 deletions
1
scripts/testing/docker_registry_image_file_permissions/testfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
this file should totally exist |
3 changes: 3 additions & 0 deletions
3
scripts/testing/docker_registry_image_file_whitelist_dockerignore/.dockerignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* | ||
|
||
!empty |
2 changes: 2 additions & 0 deletions
2
scripts/testing/docker_registry_image_file_whitelist_dockerignore/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FROM scratch | ||
COPY empty /empty |
1 change: 1 addition & 0 deletions
1
scripts/testing/docker_registry_image_file_whitelist_dockerignore/empty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This this an empty file |
17 changes: 17 additions & 0 deletions
17
testdata/resources/docker_registry_image/testDockerRegistryImageFilePermissions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
provider "docker" { | ||
alias = "private" | ||
registry_auth { | ||
address = "%s" | ||
} | ||
} | ||
|
||
resource "docker_registry_image" "file_permissions" { | ||
provider = "docker.private" | ||
name = "%s" | ||
insecure_skip_verify = true | ||
|
||
build { | ||
context = "%s" | ||
dockerfile = "%s" | ||
} | ||
} |