-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
74 lines (57 loc) · 2.51 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
# Base Image
FROM ubuntu:20.04
RUN useradd -ms /bin/bash komatsu
SHELL ["/bin/bash", "-c"]
# Set any environment
ENV CC=/usr/bin/clang-10
ENV CXX=/usr/bin/clang++-10
ENV CPP=/usr/bin/clang-cpp-10
WORKDIR /usr/src/ros_ws/src
# APT Update to get current locations.
RUN apt-get update --assume-yes && apt-get upgrade --assume-yes
RUN DEBIAN_FRONTEND="noninteractive" apt-get install --assume-yes \
clang-10 \
gpg \
wget \
git \
cmake \
locales \
curl \
gnupg \
lsb-release
# Set Locale
RUN locale-gen en_US en_US.UTF-8 && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
# Add the ROS 2 apt repository to your system. First authorize our GPG key with apt.
RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" \
| tee /etc/apt/sources.list.d/ros2.list > /dev/null
# Install ROS 2 packages.
RUN apt-get update && apt-get install --assume-yes ros-galactic-desktop python3-colcon-common-extensions python3-rosdep2
# Install Gaia.
RUN curl --limit-rate 1G -o /home/komatsu/gaia-0.3.1_amd64.deb \
https://gaia-sdk.s3.us-west-2.amazonaws.com/private-releases/0.3.1-beta/gaia-0.3.1_amd64.deb && \
apt install -y /home/komatsu/gaia-0.3.1_amd64.deb && \
chown komatsu:komatsu /home/komatsu/gaia-0.3.1_amd64.deb
# Switch to user komatsu.
USER komatsu
RUN mkdir -p /home/komatsu/ros_ws/src
WORKDIR /home/komatsu/ros_ws
RUN echo 'source /opt/ros/galactic/setup.bash' >> ~/.bashrc && rosdep update
# Checkout ROS-TCP-Endpoint & rosbag2_snapshot.
RUN cd src && \
git clone -b ROS2 https://github.com/Unity-Technologies/ROS-TCP-Endpoint.git && \
git clone https://github.com/gaia-platform/rosbag2_snapshot.git
# Build
RUN source /opt/ros/galactic/setup.bash && colcon build && echo 'source ~/ros2_ws/install/local_setup.bash' >> ~/.bashrc
# Copy the danger_zone project.
COPY Ros/src/danger_zone_msgs src/danger_zone_msgs
COPY Ros/src/danger_zone src/danger_zone
# rosdep needs root to install ros packages.
USER root
RUN source /opt/ros/galactic/setup.bash && rosdep update && rosdep install -y -i --from-paths .
USER komatsu
RUN nohup bash -c "gaia_db_server --data-dir ~/.komatsu_db &" && sleep 1 && \
source /opt/ros/galactic/setup.bash && colcon build
# Unless overridden, this is the command line that will be executed
# when the container is run.
# CMD ["node", "agent.js"]