-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added --chmod for ADD and COPY commands. Fixes #2850
- Loading branch information
1 parent
a0105f6
commit 778ac1c
Showing
8 changed files
with
195 additions
and
62 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM alpine@sha256:5ce5f501c457015c4b91f91a15ac69157d9b06f1a75cf9107bf2b62e0843983a | ||
# Create dev user and group, with id 1001 | ||
RUN yes | adduser -u 1001 dev | ||
RUN yes | adduser -u 1002 other | ||
|
||
ADD --chmod=0666 context/foo /path/file666 | ||
ADD context/foo /path/file | ||
|
||
ADD --chmod=777 context/qux /path/dir777 | ||
ADD context/qux /path/dir | ||
|
||
# ADD tests | ||
RUN test "$(stat -c "%a" /path/file666)" = "666" | ||
RUN test "$(stat -c "%a" /path/file)" = "775" | ||
|
||
RUN test "$(stat -c "%a" /path/dir777)" = "777" | ||
RUN ls -la /path/dir777/ | ||
RUN test "$(stat -c "%a" /path/dir777/qup)" = "777" | ||
RUN test "$(stat -c "%a" /path/dir777/quw)" = "777" | ||
RUN test "$(stat -c "%a" /path/dir777/quw/que)" = "777" | ||
|
||
RUN test "$(stat -c "%a" /path/dir)" = "775" | ||
RUN test "$(stat -c "%a" /path/dir/qup)" = "664" | ||
RUN test "$(stat -c "%a" /path/dir/quw)" = "775" | ||
RUN test "$(stat -c "%a" /path/dir/quw/que)" = "664" | ||
|
||
# COPY tests | ||
|
||
COPY --chmod=0755 context/foo /path/copyfile755 | ||
COPY context/foo /path/copyfile | ||
COPY --chmod=755 context/qux /path/copydir755 | ||
COPY context/qux /path/copydir | ||
|
||
RUN test "$(stat -c "%a" /path/copyfile755)" = "755" | ||
RUN test "$(stat -c "%a" /path/copyfile)" = "775" | ||
|
||
RUN test "$(stat -c "%a" /path/copydir755)" = "755" | ||
RUN test "$(stat -c "%a" /path/copydir755/qup)" = "755" | ||
RUN test "$(stat -c "%a" /path/copydir755/quw)" = "755" | ||
RUN test "$(stat -c "%a" /path/copydir755/quw/que)" = "755" | ||
|
||
RUN test "$(stat -c "%a" /path/copydir)" = "775" | ||
RUN test "$(stat -c "%a" /path/copydir/qup)" = "664" | ||
RUN test "$(stat -c "%a" /path/copydir/quw)" = "775" | ||
RUN test "$(stat -c "%a" /path/copydir/quw/que)" = "664" |
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
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
Oops, something went wrong.