forked from peasant98/SAM2-Docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
119 lines (96 loc) · 4.03 KB
/
Dockerfile
File metadata and controls
119 lines (96 loc) · 4.03 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# Use an NVIDIA CUDA image as the base
FROM nvidia/cuda:12.2.0-devel-ubuntu20.04
# Set up environment variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PATH="${PATH}:/home/user/.local/bin"
# We love UTF!
ENV LANG C.UTF-8
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Set the nvidia container runtime environment variables
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV CUDA_HOME="/usr/local/cuda"
ENV TORCH_CUDA_ARCH_LIST="6.0 6.1 7.0 7.5 8.0 8.6+PTX 8.9"
# Install some handy tools. Even Guvcview for webcam support!
RUN set -x \
&& apt-get update \
&& apt-get install -y apt-transport-https ca-certificates \
&& apt-get install -y git vim tmux nano htop sudo curl wget gnupg2 \
&& apt-get install -y bash-completion \
&& apt-get install -y guvcview \
&& rm -rf /var/lib/apt/lists/* \
&& useradd -ms /bin/bash user \
&& echo "user:user" | chpasswd && adduser user sudo \
&& echo "user ALL=(ALL) NOPASSWD: ALL " >> /etc/sudoers
RUN set -x \
&& apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
RUN set -x \
&& apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y python3.11 python3.11-venv python3.11-dev \
&& apt-get install -y python3.11-tk
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 2
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
WORKDIR /home/user
RUN git clone https://github.com/facebookresearch/segment-anything-2 && \
cd segment-anything-2 && \
python3.11 -m pip install -e . -v && \
python3.11 -m pip install -e ".[demo]" && \
cd checkpoints && ./download_ckpts.sh && cd ..
RUN apt-get update \
&& apt-get install -y locales lsb-release
ARG DEBIAN_FRONTEND=noninteractive
RUN dpkg-reconfigure locales
RUN set -x \
&& sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' \
&& apt install -y curl \
&& curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add - \
&& apt-get update \
&& apt install -y ros-noetic-desktop-full
RUN set -x \
&& apt install -y python3-rosdep \
&& apt-get install -y python3-pyqt5 \
&& pip3 install shiboken2
RUN set -x \
&& rosdep init \
&& rosdep fix-permissions \
&& apt install -y gnome-terminal \
&& apt install -y libgirepository1.0-dev \
&& apt remove -y python3-pycryptodome
RUN usermod -aG dialout user
USER user
RUN rosdep update
RUN echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
RUN sudo apt-get install -y python3-pip
RUN python3 -m pip install PyGObject --force-reinstall
RUN pip3 install pycryptodome
RUN sudo apt install -y ros-noetic-desktop-full
# Install Open3D system dependencies and pip
# RUN apt-get update && apt-get install --no-install-recommends -y \
# libgl1 \
# libgomp1 \
# python3-pip \
# && sudo rm -rf /var/lib/apt/lists/*
# Install Open3D from the pypi repositories
# RUN python3 -m pip install --no-cache-dir --upgrade open3d
RUN sudo echo "export PYTHONPATH="${PYTHONPATH}:/home/user/segment-anything-2"" >> ~/.bashrc
RUN python3 -m pip install av && python3 -m pip install pynput
# RUN python3.8 -m pip install cmake --upgrade
# RUN cd /usr/bin && sudo rm cmake
# RUN sudo ln /home/user/.local/bin/cmake /usr/bin/cmake
# RUN git clone https://github.com/isl-org/Open3D
# RUN cd Open3D \
# && echo y | util/install_deps_ubuntu.sh \
# && mkdir build && cd build \
# && cmake .. \
# && make -j$(nproc) \
# && sudo make install \
# && sudo make install-pip-package
RUN python3.8 -m pip install --upgrade pip
RUN python3.8 -m pip install open3d==0.18.0
STOPSIGNAL SIGTERM
CMD sudo service ssh start && /bin/bash