| 1 |
# syntax=docker/dockerfile:1.4 |
| 2 |
|
| 3 |
ARG PYTHON_TAG |
| 4 |
FROM python:${PYTHON_TAG} as build |
| 5 |
|
| 6 |
ARG DEBIAN_FRONTEND="noninteractive" |
| 7 |
ARG TARGETARCH |
| 8 |
ARG PYTHON_TAG |
| 9 |
RUN \ |
| 10 |
--mount=type=cache,target=/var/cache/apt,sharing=locked,id=apt-${TARGETARCH}-${PYTHON_TAG} \ |
| 11 |
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=apt-${TARGETARCH}-${PYTHON_TAG} \ |
| 12 |
set -eux; \ |
| 13 |
rm -f /etc/apt/apt.conf.d/docker-clean; \ |
| 14 |
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' | tee /etc/apt/apt.conf.d/keep-cache; \ |
| 15 |
echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries; \ |
| 16 |
echo 'Acquire::Retries::Delay "true";' >> /etc/apt/apt.conf.d/80-retries; \ |
| 17 |
echo 'Acquire::http::Timeout "30";' >> /etc/apt/apt.conf.d/80-retries; \ |
| 18 |
echo 'Acquire::https::Timeout "30";' >> /etc/apt/apt.conf.d/80-retries; \ |
| 19 |
wget --no-hsts --tries=3 --waitretry=5 --retry-connrefused --timeout=10 \ |
| 20 |
-O /usr/share/keyrings/adoptium.asc https://packages.adoptium.net/artifactory/api/gpg/key/public; \ |
| 21 |
echo "deb [signed-by=/usr/share/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list; \ |
| 22 |
apt-get -qq update; \ |
| 23 |
apt-get -qq -y --no-install-recommends install temurin-11-jdk maven |
| 24 |
RUN \ |
| 25 |
--mount=type=cache,target=/root/.cache/pip,sharing=locked \ |
| 26 |
set -eux; \ |
| 27 |
python -m venv /jpy-build-venv; \ |
| 28 |
/jpy-build-venv/bin/pip install --upgrade pip setuptools; \ |
| 29 |
/jpy-build-venv/bin/pip install --only-binary=:all: wheel patchelf |
| 30 |
ENV JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-${TARGETARCH} \ |
| 31 |
VIRTUAL_ENV='/jpy-build-venv' \ |
| 32 |
PATH="/jpy-build-venv/bin:${PATH}" \ |
| 33 |
CI=true |
| 34 |
COPY --link . /jpy |
| 35 |
RUN \ |
| 36 |
--mount=type=cache,target=/root/.m2,sharing=locked \ |
| 37 |
cd /jpy; \ |
| 38 |
.github/env/Linux/bdist-wheel.sh |
| 39 |
|
| 40 |
FROM scratch |
| 41 |
COPY --link --from=build /jpy/dist/* . |