-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
62 lines (47 loc) · 2.05 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
# Use an NVIDIA CUDA image as the base
FROM nvidia/cuda:12.6.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.8 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 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 -m pip install -e . -v && \
python3 -m pip install -e ".[demo]" && \
cd checkpoints && ./download_ckpts.sh && cd ..
RUN usermod -aG dialout user
USER user
STOPSIGNAL SIGTERM
CMD sudo service ssh start && /bin/bash