How to download ROS Melodic on 19.04 with Docker containers
I am running Ubuntu 19.04 and as a result, unable to run ROS on my system. I was told that I could run it on my machine with docker containers, which would avoid the need of downgrading my distro. How can one accomplish this? How do I know which ROS files/dependencies need to be added to the docker containers?
Thanks.
Asked by oo92 on 2019-05-23 00:43:25 UTC
Answers
The basic answer to your question would be (after having installed Docker):
docker pull ros:melodic
Or perhaps (if you'd like to use the GUI tools as well):
docker pull osrf/ros:melodic-desktop-full
To actually run something:
docker run -it --rm osrf/ros:melodic-desktop-full roscore
As I noted in the comments, there is more to this, so I would recommend taking a look at wiki/docker for a start.
Getting used to Docker can take some time, so I would try to get comfortable with it before trying to solve all sorts of ROS-related problems with it.
Finally: running things in a Docker container is never going to give you the same experience as running them 'natively' (ie: on your host machine): using GUI tools can get involved (although tools like osrf/rocker exist), you'll be mounting directories into containers all the time, file permissions can be difficult to manage and (in my opinion) Docker isn't really meant for what you are implying you want to do with it (ie: daily development).
If you're just starting out it may not be the easiest way to get going, but it is certainly a technique that would let you run ROS Melodic on an Ubuntu Disco setup.
Asked by gvdhoorn on 2019-05-23 03:39:15 UTC
Comments
Does wiki/docker help?
Asked by gvdhoorn on 2019-05-23 02:46:10 UTC
FIrst time I'll ever be using Docker so that's a little too advanced.
Asked by oo92 on 2019-05-23 02:52:12 UTC
What is too advanced? If you can clarify what you find unclear perhaps we can help, but using Docker is never going to be easy I'm afraid. It's going to take some learning / getting used to.
If you have no experience with Docker whatsoever I would strongly recommend first completing some tutorials that focus solely on Docker itself. Don't mix in ROS. Learning multiple topics at the same time that also interact with each other is -- in my experience -- not the best thing to do.
Asked by gvdhoorn on 2019-05-23 03:23:29 UTC
I imagined so. Basically I want to know which ROS files/dependencies need to be added to docker.
Asked by oo92 on 2019-05-23 03:24:50 UTC
One of the first tutorials under the
wiki/docker
page (this one) shows you that there are already official Docker images for ROS, ROS 2, Gazebo and other projects available. See registry.hub.docker.com/ros fi.Unless you're doing something custom or specialised, I'd suggest to start with those first.
And finally: if you start from an image such as
ubuntu:xenial
, you could just follow the regular Ubuntu installation tutorials for ROS. There are no special requirements there.Refer to osrf/docker_images/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile for an example.
Asked by gvdhoorn on 2019-05-23 03:30:49 UTC
I am running
ubuntu:disco-dingo
, which is 19.04Asked by oo92 on 2019-05-23 04:43:38 UTC