-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
89 lines (72 loc) · 2.62 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Dockerfile may have following Arguments:
# tag - tag for the Base image, (e.g. 1.10.0-py3 for tensorflow)
# branch - user repository branch to clone (default: main, other option: test)
#
# To build the image:
# $ docker build -t <dockerhub_user>/<dockerhub_repo> --build-arg arg=value .
# or using default args:
# $ docker build -t <dockerhub_user>/<dockerhub_repo> .
ARG tag=1.4-cuda10.1-cudnn7-runtime
# Base image, e.g. tensorflow/tensorflow:1.12.0-py3
#FROM pytorch/pytorch:1.2-cuda10.0-cudnn7-runtime
FROM pytorch/pytorch:${tag}
LABEL maintainer='Silke Donayre'
LABEL version='0.1.0'
# Object detection with pytorch
# What user branch to clone (!)
ARG branch=main
# Install ubuntu updates and python related stuff
# link python3 to python, pip3 to pip, if needed
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
wget \
python3-setuptools \
python3-pip \
python3-wheel && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /root/.cache/pip/* && \
rm -rf /tmp/*
# Upgrade pip
RUN pip install --upgrade pip setuptools wheel && \
python --version && \
pip --version
# Set LANG environment
ENV LANG C.UTF-8
# Set the working directory
WORKDIR /srv
# Install rclone
RUN wget https://downloads.rclone.org/rclone-current-linux-amd64.deb && \
dpkg -i rclone-current-linux-amd64.deb && \
apt-get install -f && \
mkdir /srv/.rclone/ && touch /srv/.rclone/rclone.conf && \
rm rclone-current-linux-amd64.deb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install it manually due to a bug in the installation of pycocotools
RUN pip install cython==0.29.14
#Run opencv architecture
RUN DEBIAN_FRONTEND=noninteractive dpkg --add-architecture i386 &&\
apt-get update &&\
apt-get -y install libgtk2.0-dev
# Disable FLAAT authentication by default
ENV DISABLE_AUTHENTICATION_AND_ASSUME_AUTHENTICATED_USER no
# Initialization scripts
# deep-start can install JupyterLab or VSCode if requested
RUN git clone https://github.com/ai4os/deep-start /srv/.deep-start && \
ln -s /srv/.deep-start/deep-start.sh /usr/local/bin/deep-start
# Necessary for the Jupyter Lab terminal
ENV SHELL /bin/bash
# Install user app:
RUN git clone -b $branch https://github.com/ai4os-hub/obj-detection-torch && \
cd obj-detection-torch && \
pip install --no-cache-dir -e . && \
rm -rf /root/.cache/pip/* && \
rm -rf /tmp/* && \
cd ..
# Open ports (deepaas, monitoring, ide)
EXPOSE 5000 6006 8888
# Launch deepaas
CMD ["deepaas-run", "--listen-ip", "0.0.0.0", "--listen-port", "5000"]