Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "robot" container #221

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove unused Docker stage "blue_src_and_deps"
Renamed *.repos --> blue.repos and sim.repos
  • Loading branch information
amarburg committed Aug 2, 2024
commit 1b760435b7e8c1cfccfbe13eee2fbe183ff659f7
34 changes: 9 additions & 25 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ RUN apt-get -q update \
# - Switching to the non-root user
# - Copying 'blue' source from this repo into the non-root user's workspace
# - Installing blue deps using pip, apt and rosdep
# - Installs the remaining blue dependencies from blue_robot.repos
# - Installs deps from rosdep for all src dependencies
# - colcon build
#
# Does not include:
# - Importing blue deps using vcs
# - Building blue
#
FROM ci AS blue_src_and_deps
FROM ci AS robot

# Configure a new non-root user
ARG USERNAME=blue
Expand Down Expand Up @@ -98,28 +97,10 @@ RUN sudo apt-get -q update \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
&& sudo apt-get clean -y \
&& sudo rm -rf /var/lib/apt/lists/*

RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc

# The "robot" stage:
# - Installs the remaining blue dependencies from blue_robot.repos
# - Installs deps from rosdep for all src dependencies
# - colcon build
#
FROM blue_src_and_deps AS robot

WORKDIR $USER_WORKSPACE
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& vcs import src < src/blue/blue_robot.repos \
&& vcs import src < src/blue/blue.repos \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
Expand All @@ -130,6 +111,9 @@ RUN sudo apt-get -q update \
RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" \
&& colcon build

RUN echo "source ${USER_WORKSPACE}/install/setup.bash" >> /home/$USERNAME/.bashrc \
&& echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> /home/$USERNAME/.bashrc

FROM robot AS desktop

ENV DEBIAN_FRONTEND=noninteractive
Expand Down Expand Up @@ -192,7 +176,7 @@ RUN [ "/bin/bash" , "-c" , " \
WORKDIR $USER_WORKSPACE
RUN sudo apt-get -q update \
&& sudo apt-get -q -y upgrade \
&& vcs import src < src/blue/blue_sim.repos \
&& vcs import src < src/blue/sim.repos \
&& rosdep update \
&& rosdep install -y --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} \
&& sudo apt-get autoremove -y \
Expand Down
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
!blue_localization
!blue_description
!blue_demos
!blue_robot.repos
!blue_sim.repos
!blue.repos
!sim.repos
!.docker/entrypoints
!requirements-build.txt
File renamed without changes.
2 changes: 1 addition & 1 deletion blue_sim.repos → sim.repos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Note this is _in addition to_ blue_robot.repos
# Note this is _in addition to_ blue.repos
# (i.e. you need to vcs import both files independently)
#
repositories:
Expand Down
Loading