Skip to content

Commit af5e5c5

Browse files
authored
chore: add hadolint pre-commit hook (#2940)
1 parent af139c4 commit af5e5c5

File tree

4 files changed

+19
-25
lines changed

4 files changed

+19
-25
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ repos:
5252
- types-tabulate<0.8.10,>=0.7.7
5353
- attrs<21.5.0,>=21.4.0
5454
- filelock>=3.3.0,<3.6.1
55+
- repo: https://github.com/hadolint/hadolint
56+
rev: master
57+
hooks:
58+
- id: hadolint-docker

Dockerfile

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
11
FROM python:3.9-slim as base
22

3+
# hadolint ignore=DL3008,DL3009,DL3013
34
RUN apt-get update && \
4-
apt-get install -y git git-lfs=2.* python3-dev && \
5-
pip install --no-cache --upgrade pip poetry
5+
apt-get install --no-install-recommends -y git git-lfs=2.* python3-dev && \
6+
pip install --no-cache-dir --upgrade pip poetry
67

78
FROM base as builder
89

9-
RUN apt-get install -y build-essential && \
10-
apt-get clean
10+
# hadolint ignore=DL3008
11+
RUN apt-get install --no-install-recommends -y build-essential && \
12+
apt-get clean && rm -rf /var/lib/apt/lists/*
1113

1214
# The python install is done in two steps to avoid re-installing all dependencies every
1315
# time the code changes
1416
COPY pyproject.toml poetry.lock README.rst CHANGES.rst Makefile /code/renku/
1517
WORKDIR /code/renku
1618
RUN poetry export --without-hashes -f requirements.txt --output /tmp/requirements.txt && \
17-
pip install -r /tmp/requirements.txt && \
18-
pip install poetry-dynamic-versioning==0.17.1
19+
pip install --no-cache-dir -r /tmp/requirements.txt && \
20+
pip install --no-cache-dir poetry-dynamic-versioning==0.17.1
1921

2022
COPY .git /code/renku/.git
2123
COPY renku /code/renku/renku
2224

2325
# Set CLEAN_INSTALL to a non-null value to ensure that only a committed version of
2426
# renku-python is installed in the image. This is the default for chartpress builds.
2527
ARG CLEAN_INSTALL
26-
RUN if [ -n "${CLEAN_INSTALL}" ]; then git reset --hard ; fi
27-
28-
RUN make download-templates
28+
RUN if [ -n "${CLEAN_INSTALL}" ]; then git reset --hard ; fi && \
29+
make download-templates
2930

3031
# set the BUILD_CORE_SERVICE to non null to install additional service dependencies
3132
ARG BUILD_CORE_SERVICE
32-
RUN if [ -n "${BUILD_CORE_SERVICE}" ]; then export EXT_BUILD=[service] ; fi && \
33-
pip wheel --wheel-dir /wheels .${EXT_BUILD} && \
34-
pip install --no-index --no-warn-script-location --force --root=/pythonroot/ /wheels/*.whl
33+
RUN if [ -n "${BUILD_CORE_SERVICE}" ]; then export EXT_BUILD="[service]" ; fi && \
34+
pip wheel --wheel-dir /wheels ".${EXT_BUILD}" && \
35+
pip install --no-cache-dir --no-index --no-warn-script-location --force --root=/pythonroot/ /wheels/*.whl
3536

3637
FROM base
3738

39+
ARG BUILD_CORE_SERVICE
3840
RUN addgroup -gid 1000 shuhitsu && \
3941
useradd -m -u 1000 -g shuhitsu shuhitsu && \
4042
git lfs install && \
41-
if [ -n "${BUILD_CORE_SERVICE}"]; then mkdir /svc && chown shuhitsu:shuhitsu /svc ; fi
43+
if [ -n "${BUILD_CORE_SERVICE}" ]; then mkdir /svc && chown shuhitsu:shuhitsu /svc ; fi
4244

4345
COPY --from=builder /pythonroot/ /
4446

renku/ui/cli/Dockerfile

Lines changed: 0 additions & 12 deletions
This file was deleted.

renku/ui/cli/requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)