-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Add hadolint to PR-verify * fix: hadolint warnings
- Loading branch information
1 parent
2a4fb3c
commit 7eb6b18
Showing
3 changed files
with
95 additions
and
26 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: PR-verify | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
changed-files: | ||
name: Detect changed dockerfiles | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.changed-files.outputs.all_changed_files }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Get changed dockerfiles | ||
id: changed-files | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
matrix: true | ||
files: | | ||
**/Dockerfile | ||
lint-dockerfiles: | ||
name: Lint dockerfiles with hadolint | ||
runs-on: ubuntu-latest | ||
needs: [changed-files] | ||
strategy: | ||
matrix: | ||
files: ${{ fromJSON(needs.changed-files.outputs.matrix) }} | ||
max-parallel: 4 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Run hadolint | ||
uses: hadolint/hadolint-action@v3.1.0 | ||
with: | ||
dockerfile: ${{ matrix.files }} | ||
|
||
|
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,19 +1,29 @@ | ||
FROM alpine:3.18 | ||
FROM alpine:3.20 AS downloader | ||
|
||
MAINTAINER victor@vrdominguez.es | ||
|
||
RUN apk update && apk add perl-libwww curl \ | ||
RUN apk add --no-cache \ | ||
curl=8.9.0-r0 \ | ||
tar=1.35-r2 \ | ||
gzip=1.13-r0 \ | ||
&& curl -o ./dinaip.tar.gz https://dinahosting.com/utilidades/estandar/aplicaciones/dinaIP-consola.tar.gz \ | ||
&& tar xzpf ./dinaip.tar.gz -C /tmp/ && rm -f ./dinaip.tar.gz \ | ||
&& cd /tmp/dinaIP-consola && sh ./install.sh && cd -- && rm -rf /tmp/dinaIP-consola \ | ||
&& sed -i '/use Cwd/a no warnings experimental;' /opt/dinaip/dinaip.pl \ | ||
&& ln -sf /proc/self/fd/1 /var/log/dinaip.log | ||
&& tar xzpf ./dinaip.tar.gz -C /tmp/ && rm -f ./dinaip.tar.gz | ||
|
||
FROM alpine:3.20 | ||
|
||
ADD bootstrap.sh / | ||
LABEL matainer="Víctor R. Rodríguez Domínguez <victor@vrdominguez.es>" | ||
|
||
RUN chmod a+x /bootstrap.sh | ||
ENV DHUSER='mydinahostinguser' \ | ||
DHPASS='mydinahostingpass' | ||
|
||
ENV DHUSER='mydinahostinguser' | ||
ENV DHPASS='mydinahostingpass' | ||
COPY bootstrap.sh / | ||
COPY --from=downloader /tmp/dinaIP-consola/* /opt/dinaip/ | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
perl-libwww=6.77-r0 \ | ||
curl=8.9.0-r0 \ | ||
&& ln -s /opt/dinaip/dinaip.pl /usr/sbin/dinaip \ | ||
&& sed -i '/use Cwd/a no warnings experimental;' /opt/dinaip/dinaip.pl \ | ||
&& ln -sf /proc/self/fd/1 /var/log/dinaip.log \ | ||
&& chmod a+x /bootstrap.sh | ||
|
||
CMD "/bootstrap.sh" | ||
CMD ["/bootstrap.sh"] |
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,20 +1,36 @@ | ||
FROM alpine:3.20 AS downloader | ||
|
||
RUN apk add --no-cache \ | ||
curl=8.9.0-r0 \ | ||
tar=1.35-r2 \ | ||
gzip=1.13-r0 \ | ||
&& curl -o ./dinaip.tar.gz https://dinahosting.com/utilidades/estandar/aplicaciones/dinaIP-consola.tar.gz \ | ||
&& tar xzpf ./dinaip.tar.gz -C /tmp/ && rm -f ./dinaip.tar.gz | ||
|
||
|
||
FROM debian:bookworm-slim | ||
|
||
MAINTAINER victor@vrdominguez.es | ||
LABEL matainer="Víctor R. Rodríguez Domínguez <victor@vrdominguez.es>" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends perl libwww-perl ca-certificates curl procps \ | ||
&& curl -o ./dinaip.tar.gz https://dinahosting.com/utilidades/estandar/aplicaciones/dinaIP-consola.tar.gz \ | ||
&& tar xzpf ./dinaip.tar.gz -C /tmp/ && rm -f ./dinaip.tar.gz \ | ||
&& cd /tmp/dinaIP-consola && sh ./install.sh && cd -- && rm -rf /tmp/dinaIP-consola \ | ||
&& apt-get autoremove -y && apt-get clean -y \ | ||
&& sed -i '/use Cwd/a no warnings experimental;' /opt/dinaip/dinaip.pl | ||
ENV DHUSER='mydinahostinguser' \ | ||
DHPASS='mydinahostingpass' | ||
|
||
ADD bootstrap.sh / | ||
COPY bootstrap.sh / | ||
COPY --from=downloader /tmp/dinaIP-consola/* /opt/dinaip/ | ||
|
||
RUN chmod a+x /bootstrap.sh | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
perl=5.36.0-7+deb12u1 \ | ||
libcrypt-ssleay-perl=0.73.06-2+b1 \ | ||
libwww-perl=6.68-1 \ | ||
ca-certificates=20230311 \ | ||
curl=7.88.1-10+deb12u6 \ | ||
procps=2:4.0.2-3 \ | ||
&& ln -s /opt/dinaip/dinaip.pl /usr/sbin/dinaip \ | ||
&& apt-get autoremove -y && apt-get clean -y \ | ||
&& rm -rf /var/lib/apt/ /var/lib/dpkg/ /var/lib/cache/ /var/lib/log/ \ | ||
&& sed -i '/use Cwd/a no warnings experimental;' /opt/dinaip/dinaip.pl \ | ||
&& chmod a+x /bootstrap.sh | ||
|
||
ENV DHUSER='mydinahostinguser' | ||
ENV DHPASS='mydinahostingpass' | ||
|
||
CMD "/bootstrap.sh" | ||
CMD ["/bootstrap.sh"] |