forked from linhduongtuan/Covid-19_Xray_Classifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDocker_jetson
114 lines (89 loc) · 2.82 KB
/
Docker_jetson
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
### ATTENTION: VERY SLOW TO BUILD ON JETSON-NANO
### You can use the image (based on this dockerfile) from Docker Hub
### version of ubuntu
FROM arm64v8/ubuntu
### setup environment variables
ENV container docker
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display
### set the locale
ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8 \
LANGUAGE=C.UTF-8
### install packages
RUN apt-get update \
&& apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# setup sources.list
RUN echo "deb-src http://us.archive.ubuntu.com/ubuntu/ $(lsb_release -cs) main restricted \n\
deb-src http://us.archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-updates main restricted \n\
deb-src http://us.archive.ubuntu.com/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse \n\
deb-src http://security.ubuntu.com/ubuntu $(lsb_release -cs)-security main restricted" \
> /etc/apt/sources.list.d/official-source-repositories.list
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
apt-transport-https \
apt-utils \
bash-completion \
build-essential \
ca-certificates \
clang \
clang-format \
cmake \
cmake-curses-gui \
curl \
gconf2 \
gconf-service \
gdb \
git-core \
git-gui \
gvfs-bin \
inetutils-ping \
llvm \
llvm-dev \
nano \
net-tools \
pkg-config \
shared-mime-info \
software-properties-common \
sudo \
tzdata \
unzip \
wget \
python3-dev \
python3-numpy \
python3-setuptools \
python3-pip \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade pip==9.0.3 \
&& pip3 install setuptools
# install packages
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive TERM=linux apt-get install --no-install-recommends -q -y \
mesa-utils \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
### Install ML/dependencies from requirements.txt
# Install PyTorch
RUN echo "downloading PyTorch wheel associated with jetpack" ; \
wget -v -O torch-1.1.0a0+ed8c462-cp36-cp36m-linux_aarch64.whl -L https://nvidia.box.com/shared/static/y86upxqgjps5nk0x10laoo2svha1juob.whl
RUN pip3 install torch-1.1.0a0+ed8c462-cp36-cp36m-linux_aarch64.whl ;\
rm -Rf torch-1.1.0a0+ed8c462-cp36-cp36m-linux_aarch64.whl
# Install Torchvision
RUN git clone -b v0.3.0 https://github.com/pytorch/vision torchvision ; \
cd torchvision
RUN python3 setup.py install
# for web server
EXPOSE 8888
ENV HOME /home/root
WORKDIR $HOME
# install required libraries
COPY requirements.txt $HOME
RUN pip3 install -r requirements.txt
RUN python3 -m ipykernel install --user
# This is the runtime command for the container
#CMD jupyter lab --ip 0.0.0.0 --no-browser --allow-root
CMD ["bash"]