@@ -39,6 +39,8 @@ RUN apt-get -q update \
39
39
&& rm -rf /var/lib/apt/lists/*
40
40
41
41
# This stage includes
42
+ # - Adding the non-root user to sudoers
43
+ # - Installing and configuring fixuid
42
44
# - Switching to the non-root user
43
45
# - Copying 'blue' source from this repo into the non-root user's workspace
44
46
# - Installing blue deps using pip, apt and rosdep
@@ -50,7 +52,7 @@ FROM ci AS robot
50
52
51
53
#
52
54
# Ubuntu 24.04 "Noble", which is used as the base image for
53
- # jazzy and rolling images, now includes a user "ubuntu" at UID 1000
55
+ # jazzy and rolling images, now includes a "built-in" user "ubuntu" at UID 1000
54
56
ARG USERNAME=ubuntu
55
57
ARG USER_UID=1000
56
58
ARG USER_GID=$USER_UID
@@ -60,6 +62,16 @@ RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
60
62
&& usermod -a -G dialout $USERNAME \
61
63
&& echo "source /usr/share/bash-completion/completions/git" >> /home/$USERNAME/.bashrc
62
64
65
+ # Install fixuid
66
+ RUN wget -O - https://github.com/boxboat/fixuid/releases/download/v0.6.0/fixuid-0.6.0-linux-amd64.tar.gz | tar -C /usr/local/bin -xzf - && \
67
+ chown root:root /usr/local/bin/fixuid && \
68
+ chmod 4755 /usr/local/bin/fixuid && \
69
+ mkdir -p /etc/fixuid && \
70
+ printf "user: ${USERNAME}\n group: ${USERNAME}\n " > /etc/fixuid/config.yml
71
+
72
+ ENTRYPOINT ["fixuid" , "-q" ]
73
+ CMD ["/bin/bash" ]
74
+
63
75
ENV DEBIAN_FRONTEND=noninteractive
64
76
65
77
# Switch to the non-root user for the rest of the installation
@@ -118,16 +130,16 @@ RUN sudo apt-get -q update \
118
130
&& sudo apt-get clean -y \
119
131
&& sudo rm -rf /var/lib/apt/lists/*
120
132
121
- # Actually build workspace
122
- RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
123
- && colcon build
124
-
125
- RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
133
+ RUN echo "if [ -f ${USER_WORKSPACE}/install/setup.bash ]; then source ${USER_WORKSPACE}/install/setup.bash; fi" >> /home/$USERNAME/.bashrc \
126
134
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc \
127
135
&& echo "source $VIRTUAL_ENV/bin/activate" >> /home/$USERNAME/.bashrc \
128
136
&& echo "\n # Ensure colcon is run in the venv\n alias colcon='python3 -m colcon'" >> /home/$USERNAME/.bashrc
129
137
130
- FROM robot AS desktop
138
+
139
+ # Actually build workspace
140
+ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
141
+ && colcon build
142
+
131
143
132
144
ENV DEBIAN_FRONTEND=noninteractive
133
145
ENV GZ_VERSION=harmonic
0 commit comments