RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/humble/Concepts/Basic/About-Client-Libraries.html?highlight=rclnodejs#community-maintained
Apache License 2.0
311 stars 70 forks source link

Dockerfile - running rclnodejs in Docker #893

Closed wayneparrott closed 1 year ago

wayneparrott commented 1 year ago

This PR introduces a Dockerfile for running rclnodejs with different versions of ROS2 and Nodejs. Prior to switching to Github Actions, a Dockerfile was provided for creating images for testing rclnodejs. This new Dockerfile restores that previous capability as well as provides a working example for developers interested in developing rclnodejs-based solutions on Docker.

The Docker file can be customized as shown below to create images based on any combination of rclnodejs git branch, ROS2 version and Nodejs version.

# Create an image configured with ROS2 including colcon, Nodejs and rclnodejs source 
# Supported ARGS:
#   ROS_DISTRO = [foxy, galactic, humble, rolling], default=rolling
#   NODE_MAJOR_VER = [12, 14, 16, 18, 19], default=19
#   BRANCH = rclnodejs git branch, default=develop
#
# examples: 
#
# Build image named 'rclnodejs' and run it with the rclnode test suite
#
#    docker build -t rclnodejs  .
#    docker run -it rclnodejs npm test
#
#
# Build an image for a specific branch of rclnodejs, version of ROS2 and Nodejs use:
#
#     docker build -t <image_name> --build-arg DISTRO=galactic .
#     docker build -t <image_name>  \
#        --build-arg ROS_DISTRO=humble \
#        --build-arg BRANCH=humble-hawksbill \
#        --build-arg NODE_MAJOR_VER=18 .
#
#
# Build and run:
#     docker run -it --rm $(docker build -q .)
#
wayneparrott commented 1 year ago

The current Windows build failures are due issue #890