-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ci): implement tests for linter
- Loading branch information
1 parent
a0dab8d
commit 9f21e75
Showing
4 changed files
with
54 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.idea | ||
.github | ||
.git | ||
tests | ||
.dockerignore | ||
Dockerfile | ||
LICENSE | ||
|
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,21 @@ | ||
FROM alpine:3.20 | ||
|
||
RUN mkdir /linter_workdir | ||
|
||
RUN addgroup -S lintergroup && adduser -S linteruser -G lintergroup && chown -R linteruser:lintergroup /linter_workdir | ||
|
||
RUN apk add --no-cache wget=1.24.5-r0 \ | ||
&& wget --progress=dot:mega -O /linter_workdir/hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 \ | ||
&& chmod +x /linter_workdir/hadolint \ | ||
&& apk del wget | ||
|
||
# NOTE: we need to have a separate directory for linter to work only with needed files, | ||
# not with files from the entire system. | ||
WORKDIR /linter_workdir | ||
|
||
USER linteruser | ||
|
||
HEALTHCHECK --timeout=1s --retries=1 CMD /linter_workdir/hadolint --version || exit 1 | ||
|
||
ENTRYPOINT ["/bin/sh", "-c", "find /linter_workdir/repo -name 'Dockerfile*' -type f | \ | ||
while read -r dockerfile; do /linter_workdir/hadolint \"$dockerfile\"; done"] |
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 @@ | ||
FROM alpine:3.20 | ||
|
||
RUN mkdir /linter_workdir | ||
|
||
RUN apk add --no-cache wget \ | ||
&& wget --progress=dot:mega -O /linter_workdir/hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64 \ | ||
&& chmod +x /linter_workdir/hadolint \ | ||
&& apk del wget | ||
|
||
# NOTE: we need to have a separate directory for linter to work only with needed files, | ||
# not with files from the entire system. | ||
WORKDIR /linter_workdir | ||
|
||
HEALTHCHECK --timeout=1s --retries=1 CMD /linter_workdir/hadolint --version || exit 1 | ||
|
||
ENTRYPOINT ["/bin/sh", "-c", "find /linter_workdir/repo -name 'Dockerfile*' -type f | \ | ||
while read -r dockerfile; do /linter_workdir/hadolint \"$dockerfile\"; done"] |