-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile_deploy
39 lines (31 loc) · 1.3 KB
/
Dockerfile_deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM kristoferb/spbase_ros2:galactic as build
ARG project_name=robotiq_2f_driver
# install any deps here and clone any external repos into the workspace
COPY ./robotiq_2f_msgs/ /ws/src/robotiq_2f_msgs
# Copy the packages and only the rust package and cargo files to build the rust deps.
COPY ./$project_name/Cargo.* \
./$project_name/package.xml \
./$project_name/r2r_cargo.cmake \
./$project_name/CMakeLists.txt \
/ws/src/$project_name/
RUN . /opt/ros/$ROS_DISTRO/setup.sh &&\
cd /ws &&\
mkdir ./src/$project_name/src/ &&\
echo "fn main() {}" > ./src/$project_name/src/main.rs &&\
colcon build
# Copy the rest of the rust code and colcon build again
COPY ./$project_name/ /ws/src/$project_name/
RUN . /opt/ros/$ROS_DISTRO/setup.sh &&\
cd /ws &&\
colcon build --packages-select $project_name
# Create a new core image without build tools
FROM kristoferb/spcore_ros2:galactic
COPY --from=build /ws/install /install/
# Install some missing deps that is needed bu not included in core. Find them here:
# http://packages.ros.org/ros2/ubuntu/dists/focal/main/binary-amd64/Packages
# RUN apt-get update -qqy \
# && apt-get install -qqy ros-galactic-geometry2 \
# && rm -rf /var/lib/apt/lists/*
RUN sed --in-place --expression \
'$isource "/install/setup.bash"' \
/entrypoint.sh