-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
143 lines (123 loc) · 5.76 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
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
# Copyright 2020-2023 Tiryoh<tiryoh@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This Dockerfile is adapted from https://github.com/Tiryoh/docker-ros2-desktop-vnc/tree/master
# which is released under the Apache-2.0 license.
FROM ubuntu:jammy-20240911.1
ARG TARGETPLATFORM
LABEL maintainer="Sylvain ARGENTIERI<sylvain.argentieri@sorbonne-universite.fr>"
SHELL ["/bin/bash", "-c"]
# Upgrade OS
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install Ubuntu Mate desktop
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
ubuntu-mate-desktop && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Add Package
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
tigervnc-standalone-server tigervnc-common \
supervisor wget curl gosu git sudo python3-pip tini \
build-essential vim sudo lsb-release locales \
bash-completion tzdata nano nextcloud-desktop terminator \
iputils-ping dos2unix && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# noVNC and Websockify
RUN git clone https://github.com/AtsushiSaito/noVNC.git -b add_clipboard_support /usr/lib/novnc
RUN pip install git+https://github.com/novnc/websockify.git@v0.10.0
RUN ln -s /usr/lib/novnc/vnc.html /usr/lib/novnc/index.html
# Set remote resize function enabled by default
RUN sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'remote');/g" /usr/lib/novnc/app/ui.js
# Disable auto update and crash report
RUN sed -i 's/Prompt=.*/Prompt=never/' /etc/update-manager/release-upgrades
RUN sed -i 's/enabled=1/enabled=0/g' /etc/default/apport
#RUN echo 'enabled=0' > /etc/default/apport
# Install Firefox
RUN DEBIAN_FRONTEND=noninteractive add-apt-repository ppa:mozillateam/ppa -y && \
echo 'Package: *' > /etc/apt/preferences.d/mozilla-firefox && \
echo 'Pin: release o=LP-PPA-mozillateam' >> /etc/apt/preferences.d/mozilla-firefox && \
echo 'Pin-Priority: 1001' >> /etc/apt/preferences.d/mozilla-firefox && \
apt-get update -q && \
apt-get install -y \
firefox && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install VSCodium
RUN wget https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg \
-O /usr/share/keyrings/vscodium-archive-keyring.asc && \
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.asc ] https://paulcarroty.gitlab.io/vscodium-deb-rpm-repo/debs vscodium main' \
| tee /etc/apt/sources.list.d/vscodium.list && \
apt-get update -q && \
apt-get install -y codium && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install ROS
ENV ROS_DISTRO=humble
# desktop or ros-base
ARG INSTALL_PACKAGE=desktop
RUN apt-get update -q && \
DEBIAN_FRONTEND=noninteractive apt-get install -y curl gnupg2 lsb-release && \
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 && \
apt-get update -q && \
apt-get install -y \
ros-${ROS_DISTRO}-${INSTALL_PACKAGE} \
ros-${ROS_DISTRO}-turtlebot3-msgs \
ros-${ROS_DISTRO}-turtlebot3-description \
ros-${ROS_DISTRO}-turtlebot3-teleop \
python3-argcomplete \
python3-colcon-common-extensions \
python3-rosdep python3-vcstool && \
rosdep init && \
rm -rf /var/lib/apt/lists/*
RUN rosdep update
# Install gazebo
RUN curl https://packages.osrfoundation.org/gazebo.gpg --output /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null && \
apt-get update -q && \
apt-get install -y \
ignition-fortress \
ros-${ROS_DISTRO}-ros-gz && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Install zenoh-bridge-ros2dds
RUN echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list > /dev/null && \
apt-get update -q && \
apt-get install -y zenoh-bridge-ros2dds && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/apt/lists/*
# Enable apt-get completion after running `apt-get update` in the container
RUN rm /etc/apt/apt.conf.d/docker-clean
# Clone and build turtlebot3 simulation package
RUN mkdir -p /opt/turtlebot3_ws/src && git clone https://github.com/mogi-ros/turtlebot3_simulations -b new_gazebo /opt/turtlebot3_ws/src
RUN . /opt/ros/$ROS_DISTRO/setup.sh && cd /opt/turtlebot3_ws && colcon build
COPY --chmod=755 ./entrypoint.sh /
RUN dos2unix /entrypoint.sh
RUN ["chmod", "+x", "/entrypoint.sh"]
ENTRYPOINT [ "/bin/bash", "-c", "/entrypoint.sh" ]
ENV USER=turtle
ENV PASSWORD=turtlebot