-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile.ci
More file actions
executable file
·80 lines (70 loc) · 2.5 KB
/
Dockerfile.ci
File metadata and controls
executable file
·80 lines (70 loc) · 2.5 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# CI-only image: Ubuntu 22.04, no CUDA
FROM ubuntu:22.04
ARG USER_UID=1001
ARG USER_GID=1001
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Amsterdam
ENV PATH="/home/user/.local/bin:${PATH}"
# create user and I/O dirs
RUN groupadd --gid ${USER_GID} user \
&& useradd -m --no-log-init --uid ${USER_UID} --gid ${USER_GID} user \
&& mkdir /input /output \
&& chown user:user /input /output
WORKDIR /opt/app
RUN apt-get update && apt-get install -y --no-install-recommends \
libtiff-dev \
zlib1g-dev \
libnuma1 \
libspatialindex-dev \
curl \
cmake \
gnupg2 \
gpg-agent \
vim screen \
zip unzip \
git \
openssh-server \
build-essential \
ninja-build \
software-properties-common \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN add-apt-repository -y ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python3.11 \
python3.11-dev \
python3.11-venv \
python3.11-distutils \
&& ln -sf /usr/bin/python3.11 /usr/local/bin/python3 \
&& ln -sf /usr/bin/python3.11 /usr/bin/python3 \
&& ln -sf /usr/bin/python3.11 /usr/local/bin/python \
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
&& rm -rf /var/lib/apt/lists/*
# libjpeg-turbo 3.x (required by PyTurboJPEG>=2)
ARG LIBJPEG_TURBO_VERSION=3.1.0
RUN curl -fsSL https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/${LIBJPEG_TURBO_VERSION}/libjpeg-turbo-${LIBJPEG_TURBO_VERSION}.tar.gz \
| tar xz -C /tmp \
&& cd /tmp/libjpeg-turbo-${LIBJPEG_TURBO_VERSION} \
&& cmake -G"Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/usr/local . \
&& make -j"$(nproc)" && make install \
&& ldconfig \
&& rm -rf /tmp/libjpeg-turbo-${LIBJPEG_TURBO_VERSION}
# ASAP
ARG ASAP_URL=https://github.com/computationalpathologygroup/ASAP/releases/download/ASAP-2.2-(Nightly)/ASAP-2.2-Ubuntu2204.deb
RUN set -eux; \
apt-get update; \
curl -L "${ASAP_URL}" -o /tmp/ASAP.deb; \
apt-get install -y --no-install-recommends /tmp/ASAP.deb; \
SITE_PACKAGES=$(python3 -c "import sysconfig; print(sysconfig.get_paths()['purelib'])"); \
printf "/opt/ASAP/bin/\n" > "${SITE_PACKAGES}/asap.pth"; \
rm -f /tmp/ASAP.deb; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*
RUN python -m ensurepip --upgrade \
&& python -m pip install --upgrade pip setuptools pip-tools \
&& python -m pip install hatchling psutil \
&& rm -rf /home/user/.cache/pip
USER user
WORKDIR /opt/app