Skip to content

Commit

Permalink
Organized Dockerfiles
Browse files Browse the repository at this point in the history
Signed-off-by: Shintaro Sakoda <[email protected]>
  • Loading branch information
SakodaShintaro committed Mar 11, 2024
1 parent 6c6d0e1 commit 7d83065
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 63 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ROS_DISTRO: [melodic, melodic_llvm, noetic, noetic_llvm, foxy, foxy_llvm, galactic, galactic_llvm]
ROS_DISTRO: [foxy, galactic, humble]

steps:
- uses: actions/checkout@v2
Expand All @@ -28,9 +28,20 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Docker build
- name: Docker build gcc
uses: docker/build-push-action@v2
with:
file: ${{github.workspace}}/docker/${{ matrix.ROS_DISTRO }}/Dockerfile
file: ${{github.workspace}}/docker/Dockerfile_gcc
context: .
push: false
build-args: |
ROS_DISTRO=${{ matrix.ROS_DISTRO }}
- name: Docker build llvm
uses: docker/build-push-action@v2
with:
file: ${{github.workspace}}/docker/Dockerfile_llvm
context: .
push: false
build-args: |
ROS_DISTRO=${{ matrix.ROS_DISTRO }}
10 changes: 6 additions & 4 deletions docker/foxy/Dockerfile → docker/Dockerfile_gcc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
FROM ros:foxy
ARG ROS_DISTRO

FROM ros:${ROS_DISTRO}

RUN apt-get update && apt-get install -y --no-install-recommends \
wget nano build-essential libomp-dev clang lld git\
ros-foxy-geodesy ros-foxy-pcl-ros ros-foxy-nmea-msgs \
ros-foxy-rviz2 ros-foxy-libg2o \
ros-${ROS_DISTRO}-geodesy ros-${ROS_DISTRO}-pcl-ros ros-${ROS_DISTRO}-nmea-msgs \
ros-${ROS_DISTRO}-rviz2 ros-${ROS_DISTRO}-libg2o \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -16,7 +18,7 @@ WORKDIR /root/colcon_ws/src
COPY . /root/colcon_ws/src/ndt_omp/

WORKDIR /root/colcon_ws
RUN /bin/bash -c '. /opt/ros/foxy/setup.bash; colcon build'
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; colcon build'
RUN sed -i "6i source \"/root/colcon_ws/devel/setup.bash\"" /ros_entrypoint.sh

WORKDIR /
Expand Down
8 changes: 4 additions & 4 deletions docker/foxy_llvm/Dockerfile → docker/Dockerfile_llvm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ros:foxy
FROM ros:${ROS_DISTRO}

RUN apt-get update && apt-get install -y --no-install-recommends \
wget nano build-essential libomp-dev clang lld git\
ros-foxy-geodesy ros-foxy-pcl-ros ros-foxy-nmea-msgs \
ros-foxy-rviz2 ros-foxy-libg2o \
ros-${ROS_DISTRO}-geodesy ros-${ROS_DISTRO}-pcl-ros ros-${ROS_DISTRO}-nmea-msgs \
ros-${ROS_DISTRO}-rviz2 ros-${ROS_DISTRO}-libg2o \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand All @@ -18,7 +18,7 @@ COPY . /root/colcon_ws/src/ndt_omp/
RUN update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld 50

WORKDIR /root/colcon_ws
RUN /bin/bash -c '. /opt/ros/foxy/setup.bash; CC=clang CXX=clang++ colcon build'
RUN /bin/bash -c '. /opt/ros/${ROS_DISTRO}/setup.bash; CC=clang CXX=clang++ colcon build'
RUN sed -i "6i source \"/root/colcon_ws/devel/setup.bash\"" /ros_entrypoint.sh

WORKDIR /
Expand Down
25 changes: 0 additions & 25 deletions docker/galactic/Dockerfile

This file was deleted.

27 changes: 0 additions & 27 deletions docker/galactic_llvm/Dockerfile

This file was deleted.

0 comments on commit 7d83065

Please sign in to comment.