-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile.gpu
167 lines (134 loc) · 4.77 KB
/
Dockerfile.gpu
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
ARG UBUNTU_VERSION=18.04
FROM nvidia/cudagl:10.0-devel-ubuntu${UBUNTU_VERSION} as base
# This line instructs `debconf` to store in its database an answer for the program debconf.
# If (the running program) debconf later asks (the database of answers) debconf what is
# my frontend the answer will be frontend is Noninteractive.
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display
RUN apt-get update && apt-get install -y --no-install-recommends \
mesa-utils && \
rm -rf /var/lib/apt/lists/*
# Pick up some TF dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
sudo \
cuda-command-line-tools-10-0 \
cuda-cublas-10-0 \
cuda-cufft-10-0 \
cuda-curand-10-0 \
cuda-cusolver-10-0 \
cuda-cusparse-10-0 \
libcudnn7=7.4.1.5-1+cuda10.0 \
libfreetype6-dev \
libhdf5-serial-dev \
# libpng12-dev \
libzmq3-dev \
pkg-config \
software-properties-common \
wget \
git \
rsync \
unzip
# RUN apt-get update && \
# apt-get install nvinfer-runtime-trt-repo-ubuntu1604-5.0.2-ga-cuda10.0 \
# && apt-get update \
# && apt-get install -y --no-install-recommends libnvinfer5=5.0.2-1+cuda10.0 \
# && apt-get clean \
# && rm -rf /var/lib/apt/lists/*
# graphic server
RUN apt-get update && apt-get install -y x11-xserver-utils
# For CUDA profiling, TensorFlow requires CUPTI.
ENV LD_LIBRARY_PATH /usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
ARG USE_PYTHON_3_NOT_2=1
ARG _PY_SUFFIX=${USE_PYTHON_3_NOT_2:+3}
ARG PYTHON=python${_PY_SUFFIX}
ARG PIP=pip${_PY_SUFFIX}
# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
RUN apt-get update && apt-get install -y \
${PYTHON} \
${PYTHON}-pip
RUN ${PIP} --no-cache-dir install --upgrade \
pip \
setuptools
# Some TF tools expect a "python" binary
RUN ln -s $(which ${PYTHON}) /usr/local/bin/python
# Options:
# tensorflow
# tensorflow-gpu
# tf-nightly
# tf-nightly-gpu
ARG TF_PACKAGE=tf-nightly-gpu
RUN ${PIP} install ${TF_PACKAGE}
RUN ${PIP} install msgpack-rpc-python
COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=America/Detroit
RUN apt-get update && apt-get install -y tzdata
# setup timezone
RUN echo 'Etc/UTC' > /etc/timezone && \
ln -sf /usr/share/zoneinfo/Etc/UTC /etc/localtime && \
apt-get update && apt-get install -q -y tzdata && rm -rf /var/lib/apt/lists/*
# install packages
RUN apt-get update && apt-get install -q -y \
dirmngr \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116
# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > /etc/apt/sources.list.d/ros-latest.list
# install bootstrap tools
RUN apt-get update && apt-get install --no-install-recommends -y \
python-rosdep \
python-rosinstall \
python-vcstools \
&& rm -rf /var/lib/apt/lists/*
# setup environment
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_LOG_DIR=/home/sim/.ros
# bootstrap rosdep
RUN rosdep init \
&& rosdep update
# install ros packages
ENV ROS_DISTRO melodic
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-desktop
RUN ${PIP} install rospkg pyyaml osc4py3
RUN apt-get update && apt-get install -y \
python3-jinja2 \
python3-empy \
&& rm -rf /var/lib/apt/lists/*
RUN ${PIP} install numpy toml catkin_pkg \
dronekit dronekit-sitl
RUN apt-get update && apt-get install -y \
ros-${ROS_DISTRO}-image-common
RUN apt-get install -y --no-install-recommends \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgstreamer-plugins-bad1.0-dev \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-ugly \
gstreamer1.0-libav libgstrtspserver-1.0-dev \
gtk-doc-tools
ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd -g ${GROUP_ID} sim && \
useradd -m -l -u ${USER_ID} -g sim sim && \
echo "sim:sim" | chpasswd && adduser sim sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV HOME /home/sim
ENV SIM_ROOT=$HOME
RUN wget -O ArrayFire-v3.6.3_Linux_x86_64.sh https://arrayfire.s3.amazonaws.com/3.6.3/ArrayFire-v3.6.3_Linux_x86_64.sh \
&& chmod +x ./ArrayFire-v3.6.3_Linux_x86_64.sh
RUN ./ArrayFire-v3.6.3_Linux_x86_64.sh --include-subdir --prefix=/opt \
&& echo "/opt/arrayfire/lib64" > /etc/ld.so.conf.d/arrayfire.conf \
&& ldconfig
USER sim
WORKDIR $HOME