I’ve been trying to get part of an open source project PX4(
https://github.com/PX4/PX4-Autopilot) running inside the docker containers that they provide (
https://github.com/PX4/PX4-containers) but I’ve been running into some weird issues that I don’t understand. I’ve been following the guide (
https://docs.px4.io/master/en/ros/ros2_comm.html) that goes over setting up the project I’m trying to use.
If I run their px4io/px4-dev-ros2-foxy container, I can follow the tutorial no problem and get everything running. However, if I try to run the exact same commands inside my own dockerfile, it crashes. I have looked at their entrypoint.sh file and tried sourcing the same files they are sourcing but I have not been able to get it to behave the same way during the build as it behaves while just running a the container. Their entrypoint file is located in the docker container at: /usr/local/bin/entrypoint.sh
I’d really appreciate it if someone could provide more information on the differences between the build environment and a running container as it pertains to the linux shell environment.
docker run -it px4io/px4-dev-ros2-foxy
mkdir -p ~/px4_ros_com_ros2/src
git clone https://github.com/PX4/px4_ros_com.git ~/px4_ros_com_ros2/src/px4_ros_com
git clone https://github.com/PX4/px4_msgs.git ~/px4_ros_com_ros2/src/px4_msgs
source /opt/ros/foxy/setup.bash && source build_ros2_workspace.bash
docker build -t px4 --no-cache .