Skip to content

Commit

Permalink
Sadly, cache mounts are not persisted (moby/buildkit#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-fsn committed Aug 21, 2024
1 parent 2bfe701 commit 8812e75
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions images/benchmark/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,15 @@ RUN --mount=type=tmpfs,target=/tmp,rw \

FROM base as build_base
ENV OPENSSL_VER=3.3.0
ENV CCACHE_DIR=/ccache
ENV CCACHE_NOHASHDIR=true
ENV CCACHE_SLOPPINESS=include_file_ctime
ENV PATH=/usr/lib/ccache:${PATH}
RUN --mount=type=tmpfs,target=/tmp,rw \
--mount=id=var_cache_apt,type=cache,target=/var/cache/apt,sharing=locked \
--mount=id=var_lib_apt,type=cache,target=/var/lib/apt,sharing=locked \
apt-get update --error-on=any && \
apt-get install -y build-essential curl git unzip cargo ccache && \
apt-get install -y build-essential curl git unzip cargo && \
mkdir /usr/src/openssl && \
curl -sSLfo - https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VER}/openssl-${OPENSSL_VER}.tar.gz | tar zxf - -C /usr/src/openssl --strip-components=1
FROM build_base as openssl
RUN --mount=type=tmpfs,target=/tmp,rw \
--mount=id=ccache,type=cache,target=/ccache,sharing=shared \
cd /usr/src/openssl && \
# leave out unnecessary stuff to make it compile faster
./Configure no-afalgeng no-async no-autoerrinit no-capieng no-cmp no-cms no-comp no-ct no-dgram no-docs no-fips-securitychecks \
Expand All @@ -45,7 +40,6 @@ RUN --mount=type=tmpfs,target=/tmp,rw \
curl -sSLfo - https://cdn.geekbench.com/Geekbench-${GEEKBENCH_VER}-LinuxARMPreview.tar.gz | tar zxf - -C /usr/local/geekbench-aarch64 --strip-components=1
FROM build_base as python
RUN apt-get update \
--mount=id=ccache,type=cache,target=/ccache,sharing=shared \
&& apt-get install -y python3-dev && python3 -m venv --without-pip /venv && \
curl -sSLf https://bootstrap.pypa.io/get-pip.py | /venv/bin/python - && \
/venv/bin/pip install brotli bzip3 pyzstd lz4 https://github.com/bra-fsn/pyzpaq/archive/master.zip psutil && \
Expand Down

0 comments on commit 8812e75

Please sign in to comment.