-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile.sam2
More file actions
executable file
·57 lines (47 loc) · 2.12 KB
/
Dockerfile.sam2
File metadata and controls
executable file
·57 lines (47 loc) · 2.12 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
FROM pytorch/pytorch:2.3.1-cuda11.8-cudnn8-runtime
ARG user_name
ARG uid
ARG gid
ENV HOME=/root
WORKDIR ${HOME}
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && apt-get install -y --no-install-recommends \
vim zsh tmux wget htop jupyter python3 python3-pip libgl1-mesa-glx git sudo ssh libglib2.0-0 \
tree \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& apt-get clean \
&& apt-get update
# Install conda packages as root
SHELL ["/bin/bash", "-lc"]
RUN conda install -y python=3.10 pytables=3.8.0 hdf5 jupyter
# Install DeepLabCut and other pip packages as root
RUN pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir gpustat nvitop pytest PySide6==6.3.1 streamlit networkx isort black && \
pip install --no-cache-dir amadeusgpt && \
pip install --no-cache-dir git+https://github.com/DeepLabCut/DeepLabCut.git
# Initialize conda for zsh shell
RUN /opt/conda/bin/conda init zsh
# Create a non-root user
RUN mkdir /app /logs /data
RUN groupadd -g ${gid} ${user_name} \
&& useradd -m -u ${uid} -g ${gid} ${user_name} \
&& chown -R ${uid}:${gid} /home
# Switch to the new user and set home directory as working directory
USER ${user_name}
ENV HOME=/home/${user_name}
WORKDIR ${HOME}
RUN git clone https://github.com/facebookresearch/sam2.git SAM2 && cd SAM2 && pip install -e . && cd checkpoints && sh download_ckpts.sh
# Install Oh My Zsh and plugins
# RUN sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" --unattended \
# && git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
# && git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
# && sed -i 's/^plugins=(.*)$/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/' ~/.zshrc
# RUN echo "export PATH=$PATH:/home/${user_name}/.local/bin" >> /home/${user_name}/.zshrc
USER root
WORKDIR ${HOME}
# CMD ["zsh"]
# SHELL ["/bin/zsh", "-c"]
CMD ["/bin/bash"]
SHELL ["/bin/bash", "-c"]