-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
34 lines (25 loc) · 1.1 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM openjdk:18-slim AS openjdk
FROM python:3.9-slim AS python
COPY --from=openjdk /usr/local/openjdk-* /usr/local/openjdk
ENV JAVA_HOME /usr/local/openjdk
RUN update-alternatives --install /usr/bin/java java /usr/local/openjdk/bin/java 1
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update -y && \
apt-get install -y git build-essential
RUN --mount=type=cache,target=/root/.cache/pip \
([ -d /venv ] || python -m venv /venv) && \
/venv/bin/pip install --upgrade pip
WORKDIR /workspace/
ADD pyproject.toml pyproject.toml
ARG PSEUDO_VERSION=1
RUN --mount=type=cache,target=/root/.cache/pip \
SETUPTOOLS_SCM_PRETEND_VERSION=${PSEUDO_VERSION} \
/venv/bin/pip install -e .[pyterrier]
RUN --mount=source=.git,target=.git,type=bind \
--mount=type=cache,target=/root/.cache/pip \
/venv/bin/pip install -e .[pyterrier]
ENV TERRIER_VERSION="5.7"
ENV TERRIER_HELPER_VERSION="0.0.7"
RUN /venv/bin/python -c "from pyterrier import init; init(version='${TERRIER_VERSION}', helper_version='${TERRIER_HELPER_VERSION}')"
ADD . .
ENTRYPOINT ["/venv/bin/python", "-m", "ir_axioms", "--offline"]