ruffsl / ros_docker_demos

A collection of Docker demos for ROS
111 stars 24 forks source link

source devel in docker? #4

Closed 20chix closed 5 years ago

20chix commented 6 years ago

Hi

I've got this error

mub:~ mub$ docker run -it --rm \

--net foo \
--name talker \
--env ROS_HOSTNAME=talker \
--env ROS_MASTER_URI=http://master:11311\
ros:kinetic  \
rosrun roscpp_tutorials talker

[rospack] Error: package 'roscpp_tutorials' not found mub:~ mub$

Do you know how I tell docker to look for the package, i followed your tutorial but nothig

cheers Mub

ruffsl commented 5 years ago

Looks like you need to make sure you've apt installed the necessary packages into the docker image before you attempt to use that package in a container derived from that docker image. I don't think ros:kinetic image from dockerhub includes roscpp_tutorials.

That why in my examples, I create a second image based on the offical one from docker hub that installs what I need:

https://github.com/ruffsl/ros_docker_demos/blob/19dff264fa20fcb8c0df699e0efbab6e6dd154e1/multicontainer/ros-tutorials/Dockerfile#L1-L9

Which I then use in my compose file:

https://github.com/ruffsl/ros_docker_demos/blob/19dff264fa20fcb8c0df699e0efbab6e6dd154e1/multicontainer/ros-tutorials/docker-compose.yml#L7-L13