Skip to content

Commit

Permalink
jenkinsfile dockerfile cache building of wheels
Browse files Browse the repository at this point in the history
  • Loading branch information
henryborchers committed Aug 12, 2024
1 parent dbcbe5a commit 94a9e8e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ci/docker/linux/jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG SONAR_SCANNER_VERSION=5.0.1.3006
ARG PYTHON_VERSION=3.11
ARG CONAN_USER_HOME=/conan
ARG PIP_FIND_LINKS=/wheels/
ARG PIP_FIND_LINKS=/wheels
FROM python:${PYTHON_VERSION} AS base_python
RUN apt-get update -y && \
apt-get install -y --no-install-recommends ca-certificates git && \
Expand All @@ -26,8 +26,9 @@ ARG PIP_INDEX_URL
COPY requirements-dev.txt /requirements/

ARG PIP_FIND_LINKS
RUN mkdir -p ${PIP_FIND_LINKS} && \
pip wheel --wheel-dir=${PIP_FIND_LINKS} --no-cache-dir -r /requirements/requirements-dev.txt
RUN --mount=type=cache,target=/root/.cache/pip \
mkdir -p ${PIP_FIND_LINKS}/ && \
pip wheel --wheel-dir=${PIP_FIND_LINKS}/ --cache-dir /root/.cache/pip -r /requirements/requirements-dev.txt

FROM base_python AS conan_builder
ARG CONAN_USER_HOME
Expand Down Expand Up @@ -105,7 +106,7 @@ ARG PIP_EXTRA_INDEX_URL
ARG PIP_TRUSTED_HOST
COPY --from=wheel_builder ${PIP_FIND_LINKS}/* ${PIP_FIND_LINKS}/
COPY --from=wheel_builder requirements/ /requirements
RUN pip install --no-index --no-cache-dir --find-links=${PIP_FIND_LINKS} \
RUN pip install --no-index --no-cache-dir --find-links=${PIP_FIND_LINKS}/ \
-r /requirements/requirements-dev.txt

ARG CONAN_USER_HOME
Expand Down

0 comments on commit 94a9e8e

Please sign in to comment.