-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
75 lines (63 loc) · 2.37 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
ARG BASE_IMAGE=nvcr.io/nvidia/l4t-base:r32.4.4
###############################################################################################################################################
# ros dashing ros-base
#
# build
# $ docker build -t ros:dashing-ros-base-l4t-r32.4.4 .
#
# run
# $ docker run --network host -v /tmp/argus_socket:/tmp/argus_socket --runtime nvidia --rm -it ros:dashing-ros-base-l4t-r32.4.4
#
###############################################################################################################################################
FROM ${BASE_IMAGE}
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /workspace
# change the locale from POSIX to UTF-8
RUN locale-gen en_US en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
ENV LANG=en_US.UTF-8
# add the ROS deb repo to the apt sources list
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
cmake \
build-essential \
curl \
wget \
ca-certificates \
gnupg2 \
lsb-release \
&& rm -rf /var/lib/apt/lists/*
# compile and install yaml-cpp-0.6, which some ROS packages may use (but is not in the 18.04 apt repo)
RUN git clone --branch yaml-cpp-0.6.0 https://github.com/jbeder/yaml-cpp yaml-cpp-0.6 && \
cd yaml-cpp-0.6 && \
mkdir build && \
cd build && \
cmake -DBUILD_SHARED_LIBS=ON .. && \
make -j$(nproc) && \
make install && \
cd /workspace && \
rm -rf yaml-cpp-0.6
ARG ROS_PKG=ros-base
ENV ROS_DISTRO=dashing
RUN curl -Ls https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -
RUN sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2-latest.list'
# install ROS packages
RUN apt-get update && \
apt-get install -y --no-install-recommends \
ros-dashing-${ROS_PKG} \
ros-dashing-vision-msgs \
libpython3-dev \
python3-argcomplete \
python3-colcon-common-extensions \
python3-rosdep \
python3-vcstool \
&& rm -rf /var/lib/apt/lists/*
# init/update rosdep
RUN rosdep init && \
rosdep update
# setup entrypoint
WORKDIR /root/ros_workspace
COPY ./ros_entrypoint.sh /ros_entrypoint.sh
RUN echo 'source /opt/ros/'${ROS_DISTRO}'/setup.bash' >> /root/.bashrc
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]