Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fred-labs committed Jul 30, 2024
1 parent 43f9d8a commit f51d2e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
18 changes: 7 additions & 11 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ RUN DEBIAN_FRONTEND=noninteractive \
mesa-common-dev \
"ros-${ROS_DISTRO}-rmw-cyclonedds-cpp" \
"ros-${ROS_DISTRO}-ros-gz-interfaces" \
python3-pip \
"$(cat /tmp_setup/deb_requirements.txt)" && \
python3-pip && \
rm -rf /var/lib/apt/lists/*

COPY .devcontainer/ros_entrypoint.sh /ros_entrypoint.sh
Expand All @@ -38,9 +37,10 @@ RUN chmod +x /ros_entrypoint.sh
##############################################################################

RUN --mount=type=bind,target=/tmp_setup export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get update && \
xargs -a /tmp_setup/deb_requirements.txt apt-get install -y --no-install-recommends && \
rosdep update --rosdistro="${ROS_DISTRO}" && \
for d in "/tmp_setup/*"; do \
for d in /tmp_setup/*; do \
[[ ! -d "$d" ]] && continue; \
[[ "$(basename $d)" =~ ^(install|build|log)$ ]] && continue; \
rosdep install --rosdistro="${ROS_DISTRO}" --from-paths "$d" --ignore-src -r -y; \
Expand All @@ -62,16 +62,13 @@ RUN groupadd -g "$GID" "$USER" && \
echo "$USER:$PASSWORD" | chpasswd && \
echo "%sudo ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/sudogrp

RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> /etc/bash.bashrc
USER $USER


##############################################################################
## Build ROS and run ##
## Setup ROS environment ##
##############################################################################

RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> /etc/bash.bashrc
USER $USER
WORKDIR /workspace

RUN printf "if [ -f /workspace/install/setup.bash ]; then \n\
source /workspace/install/setup.bash \n\
else \n\
Expand All @@ -80,4 +77,3 @@ RUN printf "if [ -f /workspace/install/setup.bash ]; then \n\

# Switch to cyclonedds
ENV RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
ENV IGN_FILE_PATH=/workspace/install/tb4_sim_scenario/share/
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"twxs.cmake",
"donjayamanne.python-extension-pack",
"eamodio.gitlens",
"ms-iot.vscode-ros"
"ms-iot.vscode-ros",
"BenjaminEngel.asam-osc2"
]
}
},
Expand All @@ -42,7 +43,7 @@
"-e", "DISPLAY=${env:DISPLAY}"
],
"mounts": [
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=/tmp/.X11-unix,target=/tmp/.X11-unix,type=bind,consistency=cached",
"source=/dev/dri,target=/dev/dri,type=bind,consistency=cached"
],
}
1 change: 1 addition & 0 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
- 'deb_requirements.txt'
- '.github/workflows/Dockerfile'
- '.devcontainer/Dockerfile'
- '**/package.xml'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down

0 comments on commit f51d2e5

Please sign in to comment.