1- # syntax=docker/dockerfile:1.2
1+ # syntax=docker/dockerfile:1.10
22# ################################################
33#
44# We need base python dependencies on both the builder and python images, so
@@ -22,7 +22,12 @@ ENV ACTION_EXEC=python MAJOR_VERSION=${MAJOR_VERSION} BASE=${BASE}
2222
2323COPY ${MAJOR_VERSION}/dependencies.txt /opt/dependencies.txt
2424# use space efficient utility from base image
25- RUN /root/docker-apt-install.sh /opt/dependencies.txt
25+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
26+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
27+ --mount=type=bind,source=${MAJOR_VERSION}/dependencies.txt,target=/tmp/dependencies.txt \
28+ --mount=type=secret,id=ubuntu_pro_token,required=true \
29+ mkdir /workspace; \
30+ /root/docker-apt-install.sh /tmp/dependencies.txt
2631
2732# now we have python, set up a venv to install packages to, for isolation from
2833# system python libraries
@@ -42,8 +47,11 @@ FROM base-python as builder
4247ARG MAJOR_VERSION
4348
4449# install build time dependencies
45- COPY ${MAJOR_VERSION}/build-dependencies.txt /opt/build-dependencies.txt
46- RUN /root/docker-apt-install.sh /opt/build-dependencies.txt
50+ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
51+ --mount=type=cache,target=/var/lib/apt,sharing=locked \
52+ --mount=type=bind,source=${MAJOR_VERSION}/build-dependencies.txt,target=/tmp/build-dependencies.txt \
53+ --mount=type=secret,id=ubuntu_pro_token \
54+ /root/docker-apt-install.sh /tmp/build-dependencies.txt
4755
4856COPY ${MAJOR_VERSION}/requirements.txt /opt/requirements.txt
4957COPY ${MAJOR_VERSION}/packages.md /opt/packages.md
0 commit comments