Skip to content

Commit

Permalink
Merge pull request #1253 from lukaszstolarczuk/hadolint
Browse files Browse the repository at this point in the history
[CI] Add Dockerfiles linter - hadolint
  • Loading branch information
pbalcer authored Jan 17, 2024
2 parents b51dec0 + d08237c commit 8007b22
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/docker/ubuntu-22.04.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2023 Intel Corporation
# Copyright (C) 2023-2024 Intel Corporation
# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions.
# See LICENSE.TXT
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Expand Down Expand Up @@ -51,20 +51,23 @@ RUN apt-get update \
${BASE_DEPS} \
${UR_DEPS} \
${MISC_DEPS} \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean all

RUN pip3 install ${UR_PYTHON_DEPS}
# pip package is pinned to a version, but it's probably improperly parsed here
# hadolint ignore=DL3013
RUN pip3 install --no-cache-dir ${UR_PYTHON_DEPS}

# Install DPC++
COPY install_dpcpp.sh install_dpcpp.sh
COPY install_dpcpp.sh /opt/install_dpcpp.sh
ENV DPCPP_PATH=/opt/dpcpp
RUN ./install_dpcpp.sh
RUN /opt/install_dpcpp.sh

# Install libbacktrace
COPY install_libbacktrace.sh install_libbacktrace.sh
RUN ./install_libbacktrace.sh
COPY install_libbacktrace.sh /opt/install_libbacktrace.sh
RUN /opt/install_libbacktrace.sh

# Add a new (non-root) 'user'
ENV USER user
ENV USERPASS pass
RUN useradd -m $USER -g sudo -p `mkpasswd $USERPASS`
RUN useradd -m "${USER}" -g sudo -p "$(mkpasswd ${USERPASS})"
34 changes: 34 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Runs linter for Docker files
name: Hadolint

on:
workflow_dispatch:
push:
pull_request:
paths:
- '.github/docker/*Dockerfile'
- '.github/workflows/hadolint.yml'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
linux:
name: Hadolint
runs-on: ubuntu-latest

steps:
- name: Clone the git repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Run Hadolint
uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
with:
recursive: true
dockerfile: ".github/docker/*Dockerfile"
# ignore pinning apt packages to versions
ignore: DL3008

0 comments on commit 8007b22

Please sign in to comment.