-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (41 loc) · 1.6 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (41 loc) · 1.6 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
FROM pytorch/pytorch:2.1.2-cuda11.8-cudnn8-devel
# Arguments to build Docker Image using CUDA
ARG USE_CUDA=0
ARG TORCH_ARCH=
ARG GID=1002
ARG UID=1002
ARG USERNAME=xinyuan
ARG DOCKER_HOME_DIR=/root
ARG DOCKER_WORKDIR=/root/xinyuan
ENV AM_I_DOCKER True
ENV BUILD_WITH_CUDA "${USE_CUDA}"
ENV TORCH_CUDA_ARCH_LIST "${TORCH_ARCH}"
ENV CUDA_HOME /usr/local/cuda-11.8/
RUN mkdir -p ${DOCKER_WORKDIR}/Grounded-Segment-Anything
COPY . ${DOCKER_WORKDIR}/Grounded-Segment-Anything
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install --no-install-recommends \
# ADD
curl build-essential\
wget ffmpeg=7:* \
libsm6=2:* libxext6=2:* git=1:* nano \
vim=2:* -y \
&& apt-get clean && apt-get autoremove && rm -rf /var/lib/apt/lists/*
# ADD
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# ADD
ENV PATH="/root/.cargo/bin:${PATH}"
WORKDIR ${DOCKER_WORKDIR}/Grounded-Segment-Anything
RUN python -m pip install --no-cache-dir -e segment_anything
# When using build isolation, PyTorch with newer CUDA is installed and can't compile GroundingDINO
RUN python -m pip install --no-cache-dir wheel
RUN python -m pip install --no-cache-dir --no-build-isolation -e GroundingDINO
RUN addgroup --gid $GID $USERNAME
RUN adduser --disabled-password --gecos '' --uid $UID --gid $GID $USERNAME
RUN pip install --no-cache-dir diffusers[torch]==0.15.1 opencv-python==4.7.0.72 \
pycocotools==2.0.6 matplotlib==3.5.3 \
onnxruntime==1.14.1 onnx==1.13.1 ipykernel==6.16.2 scipy gradio openai \
# ADD
litellm
RUN chown -R ${UID}:${GID} ${DOCKER_HOME_DIR}
USER ${USERNAME}