Ask Your Question
1

Best practice for the correct user setup within a ROS docker container?

asked 2020-08-03 04:07:23 -0600

bgraysea gravatar image

updated 2020-08-03 04:07:51 -0600

docker ros states: By default, the container runs as the root user

http://wiki.ros.org/rosdep states: Do NOT run rosdep update with sudo. It is not required and will result in permission errors later on.

Trying to follow http://docs.ros.org/melodic/api/movei..., running in osrf/ros:melodic-desktop-full I am getting to Warning: running 'rosdep update' as root is not recommended. as below

Is there a recommended best practice for the correct user setup within a ROS docker container?

docker run -it -v ~/catkin_wses:/root osrf/ros:melodic-desktop-full

root@0ebd9e5101b5:/# cd /root/ws_moveit-tuts/src/

root@0ebd9e5101b5:~/ws_moveit-tuts/src# rosdep update

reading in sources list data from /etc/ros/rosdep/sources.list.d Warning: running 'rosdep update' as root is not recommended.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-03 04:13:09 -0600

gvdhoorn gravatar image

http://wiki.ros.org/rosdep states: Do NOT run rosdep update with sudo. It is not required and will result in permission errors later on.

What that page writes is good advice, for normal usage scenarios.

Setting up a Docker image is "not" normal usage, in the sense that typically, everything in a Docker container runs as root (by default).

The potential issues wiki/rosdep is warning about are what you can run into when first running things as root and then switching to a regular account. But as I wrote above, that's typically not how Dockerfiles are written.

So I believe what you are doing is OK -- inside a Docker image.

edit flag offensive delete link more

Comments

1

But of course: if you later switch to another user in a Docker container, then you should be mindful of the recommended usage of rosdep.

gvdhoorn gravatar image gvdhoorn  ( 2020-08-03 04:13:59 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-08-03 04:07:23 -0600

Seen: 184 times

Last updated: Aug 03 '20