Skip to content

Commit 258160c

Browse files
committed
Unwinds the noble-specific changes, isolate Gazebo differences
Allow setting GZ_VERSION by env variable
1 parent 3a14dee commit 258160c

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

.docker/Dockerfile

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ RUN apt-get -q update \
1818
clang-tools \
1919
python3-pip \
2020
python3-dev \
21-
python3-venv \
2221
lsb-release \
2322
wget \
2423
gnupg \
@@ -39,14 +38,14 @@ RUN apt-get -q update \
3938

4039
FROM ci AS robot
4140

42-
#
43-
# Ubuntu 24.04 "Noble", which is used as the base image for
44-
# jazzy and rolling images, now includes a user "ubuntu" at UID 1000
45-
ARG USERNAME=ubuntu
41+
# Configure a new non-root user
42+
ARG USERNAME=blue
4643
ARG USER_UID=1000
4744
ARG USER_GID=$USER_UID
4845

49-
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
46+
RUN groupadd --gid $USER_GID $USERNAME \
47+
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
48+
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
5049
&& chmod 0440 /etc/sudoers.d/$USERNAME \
5150
&& usermod -a -G dialout $USERNAME \
5251
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
@@ -57,17 +56,6 @@ ENV DEBIAN_FRONTEND=noninteractive
5756
USER $USERNAME
5857
ENV USER=$USERNAME
5958

60-
# Python in Ubuntu is now marked as a "Externally managed environment",
61-
# Per best practice, create a venv for local python packages
62-
# Is there a more elegant way to handle this?
63-
#
64-
# These two ENVs effectively "activate" the venv for subsequent calls to
65-
# python/pip in the Dockerfile
66-
WORKDIR /home/$USERNAME
67-
ENV VIRTUAL_ENV=/home/$USERNAME/.venv/blue
68-
RUN python3 -m venv --system-site-packages --symlinks $VIRTUAL_ENV
69-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
70-
7159
# Install MAVROS dependencies
7260
WORKDIR /home/$USERNAME
7361
RUN wget https://raw.githubusercontent.com/mavlink/mavros/ros2/mavros/scripts/install_geographiclib_datasets.sh \
@@ -109,13 +97,12 @@ RUN sudo apt-get -q update \
10997
&& sudo rm -rf /var/lib/apt/lists/*
11098

11199
RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
112-
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \
113-
&& echo "\n# Ensure colcon is run in the venv\nalias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc
100+
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc
114101

115102
FROM robot AS desktop
116103

117104
ENV DEBIAN_FRONTEND=noninteractive
118-
ENV GZ_VERSION=harmonic
105+
ENV GZ_VERSION=${GZ_VERSION:-harmonic}
119106

120107
# Gazebo Binary availability:
121108
# Humble: Garden
@@ -143,7 +130,6 @@ RUN sudo apt-get -q update \
143130
xterm \
144131
libgz-sim?-dev \
145132
rapidjson-dev \
146-
cppzmq-dev \
147133
libopencv-dev \
148134
&& sudo apt-get autoremove -y \
149135
&& sudo apt-get clean -y \

blue.repos

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
repositories:
22

3-
ros_gz:
4-
type: git
5-
url: https://github.com/gazebosim/ros_gz
6-
version: ros2
7-
83
hydrodynamics:
94
type: git
105
url: https://github.com/Robotic-Decision-Making-Lab/hydrodynamics.git

0 commit comments

Comments
 (0)