-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.ntrip_client.old
executable file
·42 lines (29 loc) · 1.51 KB
/
Dockerfile.ntrip_client.old
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
40
41
42
# This is the general dockerfile that can create an image from any ros package in this directory except (for now) uros
# which has its own, separate dockerfile to run
# To run this dockerfile and create the image, all you need to do is use the following command:
# docker build -t [name of the image you would like to create] --build-arg NODE_NAME=[name of the folder that the ros package is in] .
# The name of the image is arbitrary but the convention currently is to use the name: sailbot_[name of the folder that the ros package is in]
# so for example if I am building the rc node, I would do: docker build -t sailbot_rc --build-arg NODE_NAME=rc .
ARG ROS_DISTRO=humble
FROM ros:${ROS_DISTRO} as base
ENV ROS_DISTRO=${ROS_DISTRO}
SHELL ["/bin/bash", "-c"]
# Create Colcon workspace
RUN mkdir -p /sailbot_ws/src
WORKDIR /sailbot_ws/src
RUN mkdir /sailbot_ws/src/ntrip_client
RUN sudo apt-get update \
&& sudo apt install python3-pip -y
RUN pip3 install setuptools==58.2.0
# Copy in all of the packages required for the current node
COPY ntrip_client /sailbot_ws/src/ntrip_client
# Build the base Colcon workspace, installing dependencies first.
WORKDIR /sailbot_ws
RUN source /opt/ros/${ROS_DISTRO}/setup.bash \
&& apt-get update -y \
&& rosdep install --from-paths src --ignore-src --rosdistro ${ROS_DISTRO} -y \
&& colcon build --symlink-install
# Start the ROS node through ros2 run
CMD source /opt/ros/${ROS_DISTRO}/setup.bash \
&& source install/setup.bash \
&& ros2 launch ntrip_client ntrip_client_launch.py