-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
80 lines (70 loc) · 2.08 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
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
FROM hoanguyen93/mousechd
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install -qqy \
build-essential \
python3.9 \
python3-pip \
git \
mesa-utils \
x11-utils \
libegl1-mesa \
libopengl0 \
libgl1-mesa-glx \
libglib2.0-0 \
libfontconfig1 \
libxrender1 \
libdbus-1-3 \
libxkbcommon-x11-0 \
libxi6 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxcb-xinput0 \
libxcb-xfixes0 \
libxcb-shape0 \
llvm-18 \
libllvm18 \
&& apt-get clean
RUN pip install --upgrade pip && \
pip install "napari[all]" && \
pip cache purge
# Install Xpra and dependencies
RUN apt-get update && apt-get install -y wget gnupg2 apt-transport-https \
software-properties-common ca-certificates && \
wget -O "/usr/share/keyrings/xpra.asc" https://xpra.org/xpra.asc && \
wget -O "/etc/apt/sources.list.d/xpra.sources" https://raw.githubusercontent.com/Xpra-org/xpra/master/packaging/repos/focal/xpra.sources
RUN apt-get update && \
apt-get install -yqq \
xpra \
xvfb \
xterm \
sshfs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LD_LIBRARY_PATH=/opt/conda/lib/:/opt/conda/lib/python3.9/site-packages/nvidia/cudnn/lib
RUN git clone https://github.com/hnguyentt/mousechd-napari && \
cd mousechd-napari && \
pip install --no-cache-dir . && \
cd .. && rm -rf mousechd-napari
ENV DISPLAY=:100
ENV XPRA_PORT=9876
ENV XPRA_START="napari -w mousechd-napari"
ENV XPRA_EXIT_WITH_CLIENT="yes"
ENV XPRA_XVFB_SCREEN="1920x1080x24+32"
EXPOSE 9876
CMD echo "Launching napari on Xpra. Connect via http://localhost:$XPRA_PORT or $(hostname -i):$XPRA_PORT"; \
xpra start \
--bind-tcp=0.0.0.0:$XPRA_PORT \
--html=on \
--start="$XPRA_START" \
--exit-with-client="$XPRA_EXIT_WITH_CLIENT" \
--daemon=no \
--xvfb="/usr/bin/Xvfb +extension Composite -screen 0 $XPRA_XVFB_SCREEN -nolisten tcp -noreset" \
--pulseaudio=no \
--notifications=no \
--bell=no \
$DISPLAY