From 225e909206f8372194a41a36d5e7a660771a960b Mon Sep 17 00:00:00 2001
From: Kai Chen <chenkaidev@gmail.com>
Date: Sun, 11 Aug 2019 21:13:00 +0800
Subject: [PATCH] Add Dockerfile (#1168)

* add dockerfile

* update installation guide

* minor fix
---
 INSTALL.md        | 11 ++++++++++-
 docker/Dockerfile | 13 +++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 docker/Dockerfile

diff --git a/INSTALL.md b/INSTALL.md
index 13141ce..bbc4400 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -53,7 +53,16 @@ It is recommended that you run step d each time you pull some updates from githu
 
 2. Following the above instructions, mmdetection is installed on `dev` mode, any local modifications made to the code will take effect without the need to reinstall it (unless you submit some commits and want to update the version number).
 
-### Prepare COCO dataset
+### Another option: Docker Image
+
+We provide a [Dockerfile](docker/Dockerfile) to build an image.
+
+```shell
+# build an image with PyTorch 1.1, CUDA 10.0 and CUDNN 7.5
+docker build -t mmdetection docker/
+```
+
+### Prepare datasets
 
 It is recommended to symlink the dataset root to `$MMDETECTION/data`.
 If your folder structure is different, you may need to change the corresponding paths in config files.
diff --git a/docker/Dockerfile b/docker/Dockerfile
new file mode 100644
index 0000000..75ce054
--- /dev/null
+++ b/docker/Dockerfile
@@ -0,0 +1,13 @@
+ARG PYTORCH="1.1.0"
+ARG CUDA="10.0"
+ARG CUDNN="7.5"
+
+FROM pytorch/pytorch:${PYTORCH}-cuda${CUDA}-cudnn${CUDNN}-devel
+
+RUN apt-get update && apt-get install -y libglib2.0-0 libsm6 libxrender-dev libxext6
+
+# Install mmdetection
+RUN conda install cython -y
+RUN git clone https://github.com/open-mmlab/mmdetection.git /mmdetection
+WORKDIR /mmdetection
+RUN pip install -e .
-- 
GitLab