|
1 | 1 | FROM python:3.9-slim as base |
2 | 2 |
|
| 3 | +# hadolint ignore=DL3008,DL3009,DL3013 |
3 | 4 | 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 |
6 | 7 |
|
7 | 8 | FROM base as builder |
8 | 9 |
|
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/* |
11 | 13 |
|
12 | 14 | # The python install is done in two steps to avoid re-installing all dependencies every |
13 | 15 | # time the code changes |
14 | 16 | COPY pyproject.toml poetry.lock README.rst CHANGES.rst Makefile /code/renku/ |
15 | 17 | WORKDIR /code/renku |
16 | 18 | 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 |
19 | 21 |
|
20 | 22 | COPY .git /code/renku/.git |
21 | 23 | COPY renku /code/renku/renku |
22 | 24 |
|
23 | 25 | # Set CLEAN_INSTALL to a non-null value to ensure that only a committed version of |
24 | 26 | # renku-python is installed in the image. This is the default for chartpress builds. |
25 | 27 | 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 |
29 | 30 |
|
30 | 31 | # set the BUILD_CORE_SERVICE to non null to install additional service dependencies |
31 | 32 | 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 |
35 | 36 |
|
36 | 37 | FROM base |
37 | 38 |
|
| 39 | +ARG BUILD_CORE_SERVICE |
38 | 40 | RUN addgroup -gid 1000 shuhitsu && \ |
39 | 41 | useradd -m -u 1000 -g shuhitsu shuhitsu && \ |
40 | 42 | 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 |
42 | 44 |
|
43 | 45 | COPY --from=builder /pythonroot/ / |
44 | 46 |
|
|
0 commit comments