-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile_x
103 lines (89 loc) · 2.67 KB
/
Dockerfile_x
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
FROM nvidia/cuda:12.4.1-cudnn-devel-ubuntu22.04
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -sf /usr/share/zoneinfo/Asia/Singapore /etc/localtime && \
apt-get update && \
apt-get install -q -y --no-install-recommends tzdata
# install packages
RUN export DEBIAN_FRONTEND=noninteractive \
&& apt-get update && apt-get install -q -y --no-install-recommends \
dirmngr \
gnupg2 \
curl \
ca-certificates \
sudo \
git \
bzip2 \
libx11-6 \
tmux \
wget \
vim \
netcat \
iproute2 \
iputils-ping \
build-essential \
software-properties-common \
gdb \
libc6-dbg \
valgrind \
python3.10 \
python3-pip \
python3-dev \
libgl1-mesa-glx \
libglib2.0-0 \
libx11-xcb1 \
libxcb1 \
libxcb-glx0 \
libxcb-keysyms1 \
libxcb-image0 \
libxcb-shm0 \
libxcb-icccm4 \
libxcb-sync1 \
libxcb-xfixes0 \
libxcb-shape0 \
libxcb-randr0 \
libxcb-render-util0 \
libxcb-xinerama0 \
libxrender1 \
libxkbcommon0 \
libxkbcommon-x11-0 \
libfontconfig1 \
libfreetype6 \
xvfb \
&& update-alternatives --install /usr/bin/python python /usr/bin/python3.10 10
# setup environment
ENV DEBIAN_FRONTEND=noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_DISTRO noetic
# Env vars for the nvidia-container-runtime.
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute
# Install zsh related
RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.2/zsh-in-docker.sh)" -- \
-t ys \
-p git \
-p z \
-p https://github.com/zsh-users/zsh-autosuggestions \
-p https://github.com/zsh-users/zsh-syntax-highlighting \
&& echo "set-option -g default-shell /bin/zsh" >> ~/.tmux.conf \
&& chsh -s /bin/zsh
# install pytorch and sam-2
RUN pip install torch==2.4.1 torchvision==0.19.1 torchaudio==2.4.1 --index-url https://download.pytorch.org/whl/cu124
WORKDIR /root
RUN git clone https://github.com/CVHub520/segment-anything-2 \
&& cd segment-anything-2 \
&& pip install -e . \
&& python setup.py build_ext --inplace
# install onnxruntime-gpu
RUN pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
# Copy the project directory into the Docker image
COPY X-AnyLabeling/requirements-gpu.txt /root/requirements-gpu.txt
RUN pip install -r /root/requirements-gpu.txt \
&& pip install labelme
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# set python path
# ENV PYTHONPATH=/root/anylabeling-deploy/X-AnyLabeling
CMD zsh