Skip to content

Commit

Permalink
Add hadolint GitHub action. (#4281)
Browse files Browse the repository at this point in the history
* Add hadolint GitHub action.
* Run hadolint on CircleCI.
  • Loading branch information
fniessink authored Jul 25, 2022
1 parent 4a65eef commit 97beec1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 9 deletions.
15 changes: 15 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: 2.1

orbs:
docker: circleci/docker@2.1.2

jobs:
unittest_backend:
docker:
Expand Down Expand Up @@ -102,3 +105,15 @@ workflows:
context: QualityTime
- unittest_docs:
context: QualityTime
- docker/hadolint:
context: QualityTime
dockerfiles: "components/collector/Dockerfile:\
components/database/Dockerfile:\
components/external_server/Dockerfile:\
components/frontend/Dockerfile:\
components/internal_server/Dockerfile:\
components/ldap/Dockerfile:\
components/notifier/Dockerfile:\
components/proxy/Dockerfile:\
components/renderer/Dockerfile:\
components/testdata/Dockerfile"
29 changes: 29 additions & 0 deletions .github/workflows/hadolint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Hadolint

on: [push]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
include:
- component: collector
- component: database
- component: external_server
- component: frontend
- component: internal_server
- component: ldap
- component: notifier
- component: proxy
- component: renderer
- component: testdata

steps:
- uses: actions/checkout@v3
- name: Hadolint ${{ matrix.component }}
uses: hadolint/hadolint-action@v2.0.0
with:
dockerfile: components/${{ matrix.component }}/Dockerfile
9 changes: 5 additions & 4 deletions components/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ RUN apk --no-cache add curl=~7.80

WORKDIR /work
COPY . /work
RUN npm install -g npm@8.11.0
RUN npm install
RUN npm install -g serve@13.0.2
RUN npm run build
RUN npm install -g npm@8.11.0 && \
npm install && \
npm install -g serve@13.0.2 && \
npm run build

HEALTHCHECK CMD curl -f http://localhost:${FRONTEND_PORT:-5000}/favicon.ico || exit 1

# skipcq: DOK-DL3025
# hadolint ignore=DL3025
CMD serve --listen ${FRONTEND_PORT:-5000} --single build
15 changes: 10 additions & 5 deletions components/renderer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ LABEL description="Quality-time PDF render service"

RUN apk --no-cache add curl=~7.80

# skipcq: DOK-DL3018
RUN apk add --no-cache \
msttcorefonts-installer font-noto fontconfig \
freetype ttf-dejavu ttf-droid ttf-freefont ttf-liberation \
chromium=~99.0 \
&& rm -rf /var/cache/apk/* /tmp/*
msttcorefonts-installer=3.6-r2 \
font-noto=0_git20211101-r0 \
fontconfig=2.13.1-r4 \
freetype=2.11.1-r2 \
ttf-dejavu=2.37-r1 \
ttf-droid=20200215-r1 \
ttf-freefont=20120503-r2 \
ttf-liberation=2.00.5-r0 \
chromium=99.0.4844.84-r0 && \
rm -rf /var/cache/apk/* /tmp/*

RUN update-ms-fonts \
&& fc-cache -f
Expand Down

0 comments on commit 97beec1

Please sign in to comment.