@@ -14,9 +14,9 @@ ARG UV_CACHE_DIR=/.cache/uv
1414
1515FROM ghcr.io/astral-sh/uv:latest AS uv_builder
1616
17- FROM ubuntu:22 .04 AS base_image
18- RUN rm -f /etc/apt /apt.conf.d/docker-clean
19- RUN --mount=type=cache,target=/var/cache /apt \
17+ FROM ubuntu:24 .04 AS base_image
18+ RUN --mount=type=cache,target=/var/cache /apt,sharing=locked \
19+ --mount=type=cache,target=/var/lib /apt,sharing=locked \
2020 DEBIAN_FRONTEND="noninteractive" apt-get update && \
2121 apt-get install -yqq software-properties-common gpg-agent --no-install-recommends && \
2222 apt-get -yqq install tzdata && \
@@ -32,14 +32,14 @@ RUN --mount=type=cache,target=/var/cache/apt \
3232 python3-pip \
3333 python3-venv \
3434 ca-certificates \
35- software-properties-common \
36- jq \
37- unzip && \
38- rm -rf /var/lib/apt/lists/*
35+ software-properties-common
36+
3937
4038# ==============================================================================
4139FROM base_image AS dr_memory_builder
42- RUN apt-get update && \
40+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
41+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
42+ apt-get update && \
4343 apt-get install -y --no-install-recommends wget
4444
4545WORKDIR /drmemory
@@ -50,6 +50,10 @@ RUN wget --no-verbose https://github.com/DynamoRIO/drmemory/releases/download/re
5050
5151
5252FROM base_image AS sonar_builder
53+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
54+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
55+ apt-get update && \
56+ apt-get install -yqq --no-install-recommends unzip
5357
5458RUN case $(uname -m) in \
5559 x86_64) URL=https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip ;; \
@@ -65,37 +69,42 @@ RUN case $(uname -m) in \
6569
6670
6771FROM base_image AS conan_builder
72+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
73+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
74+ DEBIAN_FRONTEND="noninteractive" apt-get update && \
75+ apt-get install -yqq --no-install-recommends jq
76+
6877ARG CONAN_USER_HOME
6978ARG PIP_EXTRA_INDEX_URL
7079ARG PIP_INDEX_URL
7180ARG UV_EXTRA_INDEX_URL
7281ARG UV_INDEX_URL
7382
7483COPY --from=uv_builder /uv /uvx /bin/
75- COPY ci/docker/linux/shared/ensure_compiler_support_by_conan.py /tmp/ensure_compiler_support_by_conan.py
7684ARG UV_CACHE_DIR
7785ARG PIP_DOWNLOAD_CACHE
7886ARG CONAN_CENTER_PROXY_V2_URL
7987ARG CONAN_HOME
8088ENV UV_PROJECT=/tmp/uv
8189ENV UV_FROZEN=1
90+ ENV UV_PROJECT_ENVIRONMENT=/tmp/uv/venv
8291COPY ci/docker/linux/jenkins/conan/profile.ini ${CONAN_HOME}/profiles/default
8392COPY ci/docker/shared/conan/remotes.json ${CONAN_HOME}/remotes.json
8493RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
8594 --mount=type=cache,target=${UV_CACHE_DIR} \
8695 --mount=type=bind,source=pyproject.toml,target=${UV_PROJECT}/pyproject.toml \
8796 --mount=type=bind,source=uv.lock,target=${UV_PROJECT}/uv.lock \
8897 --mount=type=bind,source=conanfile.py,target=/tmp/conanfile.py \
98+ --mount=type=bind,source=conan.lock,target=${UV_PROJECT}/conan.lock \
99+ --mount=type=tmpfs,target=${UV_PROJECT_ENVIRONMENT} \
89100 uv run --only-group=conan conan profile detect --exist-ok && \
90- python3 /tmp/ensure_compiler_support_by_conan.py $(uv run --only-group=conan conan config home)/settings.yml 11.4 && \
91101 if [ "$(jq -r '.remotes[0].url' ${CONAN_HOME}/remotes.json )" != "${CONAN_CENTER_PROXY_V2_URL}" ]; then \
92102 echo "Setting the conan center url for building cache: ${CONAN_CENTER_PROXY_V2_URL}" && \
93103 cp ${CONAN_HOME}/remotes.json /tmp/remotes.json && \
94104 uv run --only-group=conan conan remote update conan-center --url ${CONAN_CENTER_PROXY_V2_URL}; \
95105 fi && \
96106 uv run --only-group=conan conan install /tmp --build missing -pr:b=default && \
97107 uv run --only-group=conan conan cache clean "*" -b --source --build --temp && \
98- rm -rf venv && \
99108 if [ "$(jq -r '.remotes[0].url' ${CONAN_HOME}/remotes.json )" != "${CONAN_CENTER_PROXY_V2_URL}" ]; then \
100109 mv -f /tmp/remotes.json ${CONAN_HOME}/remotes.json; \
101110 fi
@@ -104,7 +113,7 @@ RUN --mount=type=cache,target=${PIP_DOWNLOAD_CACHE} \
104113# shared files are needed to run the Build C++ Tests stage
105114
106115FROM base_image
107-
116+ COPY --from=uv_builder /uv /uvx /bin/
108117# -----------------------------------------------------------------------------
109118# Install sonar build-wrapper
110119# -----------------------------------------------------------------------------
0 commit comments