From c33ff8c4e0503c3cb303a457b0339abd850c32a8 Mon Sep 17 00:00:00 2001 From: Boris Glimcher <36732377+glimchb@users.noreply.github.com> Date: Fri, 12 Jan 2024 14:34:57 -0500 Subject: [PATCH] ci(lint): adding docker linter Signed-off-by: Boris Glimcher <36732377+glimchb@users.noreply.github.com> Signed-off-by: Boris Glimcher --- .github/workflows/ansible-lint.yml | 9 +++++++++ Dockerfile | 9 +++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ansible-lint.yml b/.github/workflows/ansible-lint.yml index 4f6fbfca3..7fec36802 100644 --- a/.github/workflows/ansible-lint.yml +++ b/.github/workflows/ansible-lint.yml @@ -24,6 +24,15 @@ jobs: - name: Run tests run: docker run -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest --disable=MD013 "**/*.md" || true + docker-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: hadolint/hadolint-action@v3.1.0 + with: + recursive: false + ignore: DL3041,DL3059,DL3013 + ansible-lint: runs-on: ubuntu-latest diff --git a/Dockerfile b/Dockerfile index 7f343c8f9..a82617514 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM rockylinux:8.8 WORKDIR /app # why this is not part of prereq.sh ? -RUN dnf install -y python38 iproute +RUN dnf install -y python38 iproute && dnf clean all # prereq RUN echo "SELINUX=disabled" > /etc/selinux/config @@ -19,14 +19,15 @@ RUN dnf install -y \ net-snmp \ net-snmp-utils \ sshpass \ - python3-pexpect + python3-pexpect \ +&& dnf clean all # why above RPMs are not enough ? -RUN python3 -m pip install netaddr pexpect +RUN python3 -m pip install --no-cache-dir netaddr pexpect # why this is not part of prereq.sh ? # see telemetry/roles/omnia_telemetry_cp/tasks/python_package_installation.yml -RUN python3 -m pip install pyinstaller psutil +RUN python3 -m pip install --no-cache-dir pyinstaller psutil ENTRYPOINT ["ansible-playbook"] CMD ["prepare_cp.yml", "-vv"] \ No newline at end of file