-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.kinetic.nvidia
178 lines (145 loc) · 4.88 KB
/
Dockerfile.kinetic.nvidia
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
168
169
170
171
172
173
174
175
176
177
178
# Parameters
ARG REPO_NAME="libbot2-ros"
ARG DESCRIPTION="Container with LCM, libbot, and ROS for Ubuntu 16.04"
ARG MAINTAINER="Matthew Walter ([email protected])"
# Base image
#FROM ubuntu:16.04
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu16.04
# Ubuntu version
ARG DEBIAN_FRONTEND=noninteractive
####### BEGIN: LCM INSTALLATION #######
# set default LCM_DEFAULT_URL
ENV LCM_IP "239.255.76.67"
ENV LCM_PORT "7667"
ENV LCM_TTL "1"
ENV LCM_DEFAULT_URL "udpm://$LCM_IP:$LCM_PORT?ttl=$LCM_TTL"
RUN echo "export LCM_DEFAULT_URL=udpm://\$LCM_IP:\$LCM_PORT?ttl=\$LCM_TTL" >> /etc/bash.bashrc
# set default installation dir
ENV LCM_INSTALL_DIR "/usr/local/lib"
# update apt lists and install system libraries, then clean the apt cache
RUN apt-get update && apt-get install -y \
wget \
cmake \
g++ \
libglib2.0-dev \
python-dev \
unzip \
openjdk-8-jdk \
locales \
# clean the apt cache
&& rm -rf /var/lib/apt/lists/*
# Call locale-gen
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# set the Kernel UDP buffer size to 10MB
RUN echo 'net.core.rmem_max=10485760' >> /etc/sysctl.conf
RUN echo 'net.core.rmem_default=10485760' >> /etc/sysctl.conf
# set default LCM_VERSION
ENV LCM_VERSION '1.4.0'
# install LCM
RUN \
# pull lcm
# Zip files are prepended with 'v'
wget https://github.com/lcm-proj/lcm/archive/refs/tags/v$LCM_VERSION.zip && \
# open up the source
unzip v$LCM_VERSION.zip && \
# configure, build, install, and configure LCM
cd lcm-$LCM_VERSION && mkdir build && cd build && cmake ../ && make install && ldconfig && \
# delete source code
cd / && rm -rf v$LCM_VERSION.zip lcm-$LCM_VERSION
# configure pkgconfig to find LCM
ENV PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$LCM_INSTALL_DIR/pkgconfig
####### END: LCM INSTALLATION #######
####### BEGIN: LIBBOT INSTALLATION #######
# arguments
ARG INSTALL_DIR=/usr/local
# environment variables
ENV LIBBOT2_INSTALL_DIR=$INSTALL_DIR
# install dependencies
RUN apt update \
&& apt install -y \
#sudo \
autoconf \
build-essential \
ca-certificates \
default-jdk \
doxygen \
file \
freeglut3-dev \
git \
gnupg \
libglib2.0-dev \
#libgtk-3-dev \
libjpeg8-dev \
libpng-dev \
libxmu-dev \
pkg-config \
python-dev \
python-gi \
python-numpy \
python-scipy \
wget \
zlib1g-dev \
apt-transport-https \
libsdl1.2-dev \
libusb-1.0-0-dev \
libgtk2.0-dev \
libgtkgl2.0-dev \
&& rm -rf /var/lib/apt/lists/*
# libbot2 requires cmake >=3.10, which is not installed by default on 16.04.
# The following updates the version of cmake
# Note that this does not work on arm64
# RUN apt-get remove -y cmake && \
# wget -qO- https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/kitware.gpg && \
# echo 'deb https://apt.kitware.com/ubuntu/ xenial main' \
# > /etc/apt/sources.list.d/kitware.list && \
# apt-get update && \
# apt-get install -y cmake && \
# rm -rf /var/lib/apt/lists/*
# build libbot2 from source
RUN mkdir -p /tmp/libbot2 && \
cd /tmp/libbot2 && \
# download libbot2 that requires CMAKE >= 3.5
wget https://github.com/ripl/libbot2/archive/16242507605038c1979f2ef274d5c17b9b07f417.zip && \
unzip 16242507605038c1979f2ef274d5c17b9b07f417.zip && \
mv libbot2-16242507605038c1979f2ef274d5c17b9b07f417 libbot2-code && \
# This version of libbot creates a "build" directory in libbot2-code
# and sets CMAKE_INSTALL_PREFIX to that directory rather than
# /usr/local. Comment out the lines that cause this
cd libbot2-code && \
sed -i '24 s/./#&/' CMakeLists.txt && \
sed -i '25 s/./#&/' CMakeLists.txt && \
cd .. && \
mkdir libbot2-build && \
# build libbot2
cd libbot2-build && \
#cmake -DCMAKE_INSTALL_PREFIX=$LIBBOT2_INSTALL_DIR ../libbot2-master && \
cmake -DCMAKE_INSTALL_PREFIX=$LIBBOT2_INSTALL_DIR ../libbot2-code && \
make install && \
# remove source code
cd / && \
rm -rf /tmp/libbot2
###### END: LIBBOT INSTALLATION #######
####### BEGIN: ROS INSTALLATION #######
# set ROS codename
ENV ROS_DISTRO "kinetic"
# set default ROS master hostname
ENV ROS_MASTER_HOST "localhost"
RUN apt-get update && apt-get install -y curl lsb-release
# Setup ROS sources
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Setup ROS keys
RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
# update apt lists and install system libraries, then clean the apt cache
RUN apt update && apt install -y \
ros-$ROS_DISTRO-desktop \
# clean the apt cache
&& rm -rf /var/lib/apt/lists/*
# source ROS
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /etc/bash.bashrc
# copy and set entrypoint
COPY assets/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
####### END: ROS INSTALLATION #######