napatswift commited on
Commit
52ce135
·
1 Parent(s): d1aaf8f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -29
Dockerfile CHANGED
@@ -1,29 +1,24 @@
1
- FROM python:3.9
2
-
3
- WORKDIR /code
4
-
5
- RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
6
-
7
- COPY ./requirements.txt /code/requirements.txt
8
- RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
9
-
10
- RUN pip install -qq -U openmim
11
- RUN mim install -U mmengine 'mmcv>=2.0.0rc1'
12
- RUN pip install -qq openmim 'mmdet>=3.0.0rc0' 'mmocr>=1.0.0rc0'
13
-
14
- # Set up a new user named "user" with user ID 1000
15
- RUN useradd -m -u 1000 user
16
- # Switch to the "user" user
17
- USER user
18
- # Set home to the user's home directory
19
- ENV HOME=/home/user \
20
- PATH=/home/user/.local/bin:$PATH
21
-
22
- # Set the working directory to the user's home directory
23
- WORKDIR $HOME/app
24
-
25
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
26
- COPY --chown=user . $HOME/app
27
- RUN ls
28
-
29
- CMD ["python", "main.py"]
 
1
+ ARG PYTORCH="1.9.0"
2
+ ARG CUDA="11.1"
3
+ ARG CUDNN="8"
4
+
5
+ FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
6
+
7
+ # To fix GPG key error when running apt-get update
8
+ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/3bf863cc.pub
9
+ RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
10
+
11
+ RUN apt-get update && apt-get install -y git ninja-build libglib2.0-0 libsm6 libxrender-dev libxext6 libgl1-mesa-glx \
12
+ && apt-get clean \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+ RUN pip install -U openmim
16
+ RUN mim install mmengine
17
+ RUN mim install 'mmcv>=2.0.0rc1'
18
+ RUN pip install 'mmdet>=3.0.0rc0'
19
+ RUN git clone https://github.com/open-mmlab/mmocr.git /mmocr
20
+ WORKDIR /mmocr
21
+ # ENV FORCE_CUDA="1"
22
+ RUN pip install -r requirements.txt
23
+ RUN pip install --no-cache-dir -e .
24
+ RUN pip install -r requirements/albu.txt