|
1 | | -FROM ros:iron |
| 1 | +FROM ros:jazzy |
| 2 | + |
| 3 | +ARG user=bitbots |
| 4 | +ARG uid=1000 |
| 5 | +ARG gid=1000 |
2 | 6 |
|
3 | 7 | # Basic Utilities |
4 | 8 | ENV DEBIAN_FRONTEND=noninteractive |
@@ -54,41 +58,51 @@ RUN apt update -y \ |
54 | 58 | RUN apt-get install -y \ |
55 | 59 | python3-rosdep \ |
56 | 60 | python3-vcstool \ |
57 | | - ros-iron-camera-calibration \ |
58 | | - ros-iron-desktop \ |
59 | | - ros-iron-joint-state-publisher-gui \ |
60 | | - ros-iron-plotjuggler \ |
61 | | - ros-iron-plotjuggler-msgs \ |
62 | | - ros-iron-plotjuggler-ros \ |
63 | | - ros-iron-rmw-cyclonedds-cpp \ |
64 | | - ros-iron-rqt-robot-monitor \ |
65 | | - ros-iron-soccer-vision-3d-rviz-markers |
66 | | - |
67 | | -# Update pip and install colcon-clean |
68 | | -RUN pip3 install pip -U |
69 | | - |
70 | | -# Install colcon extensions / patches |
71 | | -RUN python3 -m pip install \ |
72 | | - git+https://github.com/ruffsl/colcon-clean \ |
73 | | - git+https://github.com/timonegk/colcon-core.git@colors \ |
74 | | - git+https://github.com/timonegk/colcon-notification.git@colors \ |
75 | | - git+https://github.com/timonegk/colcon-output.git@colors |
| 61 | + python3-virtualenv \ |
| 62 | + ros-jazzy-camera-calibration \ |
| 63 | + ros-jazzy-desktop \ |
| 64 | + ros-jazzy-joint-state-publisher-gui \ |
| 65 | + ros-jazzy-plotjuggler \ |
| 66 | + ros-jazzy-plotjuggler-msgs \ |
| 67 | + ros-jazzy-plotjuggler-ros \ |
| 68 | + ros-jazzy-rmw-cyclonedds-cpp \ |
| 69 | + ros-jazzy-rqt-robot-monitor \ |
| 70 | + ros-jazzy-soccer-vision-3d-rviz-markers |
76 | 71 |
|
77 | 72 | # Set zsh as default shell |
78 | 73 | SHELL ["/bin/zsh", "-c"] |
79 | 74 |
|
80 | | -# Create home directory and colcon workspace |
81 | | -RUN mkdir -p "/root/colcon_ws" |
| 75 | +# Remove the users group, because when it exists on the host system |
| 76 | +# the devcontainer will not dynamically update the containerUser GID, |
| 77 | +# when the host user is part of the users group. |
| 78 | +# Then create a bitbots user with home directory and add allow it to use sudo |
| 79 | +RUN groupdel users \ |
| 80 | + && userdel -r ubuntu \ |
| 81 | + && useradd -m -U -u "$uid" -G sudo -s /bin/zsh $user \ |
| 82 | + && groupmod -g "$gid" $user \ |
| 83 | + && echo "$user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers |
| 84 | + |
| 85 | +USER $user |
| 86 | + |
| 87 | +# Install pip colcon extensions / patches as user |
| 88 | +RUN python3 -m pip install --user --break-system-packages \ |
| 89 | + git+https://github.com/ruffsl/colcon-clean \ |
| 90 | + git+https://github.com/timonegk/colcon-core.git@colors \ |
| 91 | + git+https://github.com/timonegk/colcon-notification.git@colors \ |
| 92 | + git+https://github.com/timonegk/colcon-output.git@colors |
| 93 | + |
| 94 | +# Create colcon workspace |
| 95 | +RUN mkdir -p /home/$user/colcon_ws/src |
82 | 96 |
|
83 | 97 | # Install oh-my-zsh for pretty terminal |
84 | 98 | RUN sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \ |
85 | | - git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
| 99 | + git clone https://github.com/zsh-users/zsh-autosuggestions "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions" |
86 | 100 |
|
87 | | -# Add zshrc |
88 | | -COPY zshrc "/root/.zshrc" |
| 101 | +# Add zshrc to bitbots home directory |
| 102 | +COPY --chown=$user:$user zshrc /home/$user/.zshrc |
89 | 103 |
|
90 | 104 | # This is required for sharing Xauthority |
91 | 105 | ENV QT_X11_NO_MITSHM=1 |
92 | 106 |
|
93 | 107 | # Switch to the workspace directory |
94 | | -WORKDIR "/root/colcon_ws" |
| 108 | +WORKDIR /home/$user/colcon_ws |
0 commit comments