Skip to content

Commit 8f4eb68

Browse files
committed
change the order of the layers to cache stonefish library first.
1 parent 470c272 commit 8f4eb68

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

Dockerfile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,27 +39,28 @@ ENV PATH="/root/.cargo/bin:${PATH}"
3939

4040
# Create workspace
4141
WORKDIR /ros2_ws
42+
COPY vendor/stonefish ./vendor/stonefish
43+
# Build Stonefish library
44+
WORKDIR /ros2_ws/vendor/stonefish
45+
RUN mkdir -p build && cd build && \
46+
cmake .. && \
47+
make -j$(nproc) && \
48+
make install && \
49+
ldconfig
50+
51+
4252
COPY src/interfaces ./src/interfaces
4353
COPY src/bringup ./src/bringup
4454
COPY src/controller_stonefish ./src/controller_stonefish
4555
COPY src/mission_executor ./src/mission_executor
4656
COPY vendor/stonefish_ros2 ./src/stonefish_ros2
47-
COPY vendor/stonefish ./vendor/stonefish
4857

4958
RUN rosdep init || true && \
5059
rosdep update
5160

5261
RUN bash -c "source /opt/ros/jazzy/setup.bash && \
5362
rosdep install --from-paths src --ignore-src -r -y || true"
5463

55-
# Build Stonefish library
56-
WORKDIR /ros2_ws/vendor/stonefish
57-
RUN mkdir -p build && cd build && \
58-
cmake .. && \
59-
make -j$(nproc) && \
60-
make install && \
61-
ldconfig
62-
6364
# Build ROS 2 workspace
6465
WORKDIR /ros2_ws
6566
RUN bash -c "source /opt/ros/jazzy/setup.bash && \

0 commit comments

Comments
 (0)