|
2 | 2 | ARG BASE_IMAGE
|
3 | 3 | FROM ${BASE_IMAGE}
|
4 | 4 |
|
5 |
| -# ======================== |
6 |
| -# install ros2 humble https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debs.html |
7 |
| -RUN apt update && apt install -y locales |
8 |
| -RUN locale-gen en_US en_US.UTF-8 |
9 |
| -RUN update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 |
10 |
| -RUN export LANG=en_US.UTF-8 |
11 |
| - |
12 |
| -RUN apt install -y software-properties-common |
13 |
| -RUN add-apt-repository universe |
14 |
| - |
15 |
| -RUN apt update && apt install curl -y |
16 |
| -RUN curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg |
17 |
| - |
18 |
| -RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | tee /etc/apt/sources.list.d/ros2.list > /dev/null |
| 5 | +# from https://github.com/athackst/dockerfiles/blob/main/ros2/humble.Dockerfile |
| 6 | +ENV DEBIAN_FRONTEND=noninteractive |
| 7 | + |
| 8 | +# Install language |
| 9 | +RUN apt-get update && apt-get install -y \ |
| 10 | + locales \ |
| 11 | + && locale-gen en_US.UTF-8 \ |
| 12 | + && update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 \ |
| 13 | + && rm -rf /var/lib/apt/lists/* |
| 14 | +ENV LANG=en_US.UTF-8 |
| 15 | + |
| 16 | +# Install timezone |
| 17 | +RUN ln -fs /usr/share/zoneinfo/UTC /etc/localtime \ |
| 18 | + && export DEBIAN_FRONTEND=noninteractive \ |
| 19 | + && apt-get update \ |
| 20 | + && apt-get install -y tzdata \ |
| 21 | + && dpkg-reconfigure --frontend noninteractive tzdata \ |
| 22 | + && rm -rf /var/lib/apt/lists/* |
| 23 | + |
| 24 | +RUN apt-get update && apt-get -y upgrade \ |
| 25 | + && rm -rf /var/lib/apt/lists/* |
19 | 26 |
|
20 |
| -RUN apt update && apt install -y ros-humble-desktop |
| 27 | +# Install common programs |
| 28 | +RUN apt-get update && apt-get install -y --no-install-recommends \ |
| 29 | + curl \ |
| 30 | + gnupg2 \ |
| 31 | + lsb-release \ |
| 32 | + sudo \ |
| 33 | + software-properties-common \ |
| 34 | + wget \ |
| 35 | + && rm -rf /var/lib/apt/lists/* |
21 | 36 |
|
| 37 | +# Install ROS2 |
| 38 | +RUN sudo add-apt-repository universe \ |
| 39 | + && curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg \ |
| 40 | + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null \ |
| 41 | + && apt-get update && apt-get install -y --no-install-recommends \ |
| 42 | + ros-humble-desktop \ |
| 43 | + python3-argcomplete \ |
| 44 | + && rm -rf /var/lib/apt/lists/* |
| 45 | + |
| 46 | +ENV ROS_DISTRO=humble |
| 47 | +ENV AMENT_PREFIX_PATH=/opt/ros/humble |
| 48 | +ENV COLCON_PREFIX_PATH=/opt/ros/humble |
| 49 | +ENV LD_LIBRARY_PATH=/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib |
| 50 | +ENV PATH=/opt/ros/humble/bin:$PATH |
| 51 | +ENV PYTHONPATH=/opt/ros/humble/local/lib/python3.10/dist-packages:/opt/ros/humble/lib/python3.10/site-packages |
| 52 | +ENV ROS_PYTHON_VERSION=3 |
| 53 | +ENV ROS_VERSION=2 |
| 54 | +ENV ROS_AUTOMATIC_DISCOVERY_RANGE=SUBNET |
| 55 | +ENV DEBIAN_FRONTEND= |
22 | 56 | # ========================
|
23 | 57 |
|
24 | 58 | WORKDIR /root/ros_ws
|
25 | 59 |
|
26 | 60 | # Install dev tools
|
27 |
| -RUN apt install -y \ |
| 61 | +RUN apt update && apt install -y \ |
28 | 62 | vim nano wget curl tree \
|
29 | 63 | cmake build-essential \
|
30 | 64 | less htop jq \
|
|
0 commit comments