ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Using ROS with Docker - Unable to set ROS_PACKAGE_PATH

asked 2016-06-15 19:26:32 -0600

AkshatAgarwal gravatar image

I'm setting up a docker container for a project of mine which runs using ROS. I'm using rosmake and need to set the ROS_PACKAGE_PATH environment variable to include my own packages before calling rosmake. In the Dockerfile, I use ENV ROS_PACKAGE_PATH /foo:$ROS_PACKAGE_PATH

However when I run the container, the ROS_PACKAGE_PATH only contains /opt/ros/indigo/share:/opt/ros/indigo/stacks I need some help with this because without setting the ROS_PACKAGE_PATH I can't invoke a rosmake from inside the Dockerfile. Since the exact same method of setting environment variables is being used, successfully to set other non-ROS-related variables, I feel it might be more of a ROS issue than a Docker issue.

Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-06-17 13:31:54 -0600

AkshatAgarwal gravatar image

The problem was that the Dockerfile set the ROS_PACKAGE_PATH env variable for build time but it got reset during run time. I solved this by putting a script that set ROS_PACKAGE_PATH inside the container and calling it in the dockerfile using a RUN command before running rosmake through the Dockerfile itself. That worked beautifully.

edit flag offensive delete link more
0

answered 2016-06-16 02:09:58 -0600

F.Brosseau gravatar image

I don't use ENV to set ROS_PACKAGE_PATH but export :

export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/foo
edit flag offensive delete link more

Comments

Not working. Do you use this in your Dockerfile or after running the container? I am able to do it after running the container, but not in the Dockerfile. I used: RUN ["/bin/bash", "-c", "export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/foo"]

AkshatAgarwal gravatar image AkshatAgarwal  ( 2016-06-16 12:53:03 -0600 )edit
1

After running the container.

We use a script to set all environment variables.

F.Brosseau gravatar image F.Brosseau  ( 2016-06-17 01:54:21 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-15 19:26:32 -0600

Seen: 662 times

Last updated: Jun 17 '16