How to use Docker with ROS + real-time kernel? [closed]
Dear ROS & Docker Users,
tl;dr: How to run Docker with linux real-time kernel (4.18.16-rt9
)? What kernel features should I turn on during rt kernel compilation? I would appreciate your help.
The error I get:
$ docker run hello-world
docker:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.
and:
$ docker info
Client: Debug Mode:
false Server: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the docker daemon running?
errors pretty printing info
Preemption Model
set during kernel compilation is: Fully Preemptible Kernel (RT) (PREEMPT_RT_FULL) (NEW)
Full description:
Hi, my name is Jakub and this is my first post on the forum. I am happy to change from "read-only mode" and join the community. I am volunteering to set up Docker on Ubuntu 18.04
with real-time kernel 4.18.16-rt9
for a robotic application in an academic setting. Docker will not run critical real-time tasks in this application, but the intention is to deploy partially containerized system on one machine to simplify the setup and testing with different software versions.
Unfortunately, I cannot start Docker on my setup. I think that 4.18.16-rt9
kernel causes the issues, because otherwise Docker works fine when I boot to 5.0.0-37
kernel on this system.
I have already tried the following:
- fully removed Docker and reinstalled it on my system.
- made sure that docker group exists and no
sudo
is required for Docker. Rebooted machine a few times while changing settings. Tried to enable Docker in three ways:
systemctl enable docker.service
systemctl start docker systemctl
enable dockerFound relevant unsolved GitHub issue and tied to run the image with
--cap-add sys_nice
and--privileged
options.Checked for some kernel feature required to run Docker (as suggested here) and found that only my
5.0.0-37
kernel was found:
$ find /lib -iname 'aufs' /lib/modules/5.0.0-37-generic/kernel/fs/aufs
/lib/modules/5.0.0-37-generic/kernel/fs/aufs/aufs.ko
/lib/modules/5.0.0-36-generic/kernel/fs/aufs
/lib/modules/5.0.0-36-generic/kernel/fs/aufs/aufs.ko
Other relevant information:
journalctl -u docker.service
last lines available here, all the output is here.
$ journalctl -u docker.service (I skipped pasting some warning lines) Dec 17 14:39:56 w530 dockerd[16869]: time="2019-12-17T14:39:56.843093125-05:00" level=warning msg="Your ke Dec 17 14:39:56 w530 dockerd[16869]: time="2019-12-17T14:39:56.843813184-05:00" level=info msg="Loading co Dec 17 14:39:56 w530 dockerd[16869]: time="2019-12-17T14:39:56.882073092-05:00" level=warning msg="Running Dec 17 14:39:57 w530 dockerd[16869]: time="2019-12-17T14:39:57.044629860-05:00" level=info msg="stopping e Dec 17 14:39:57 w530 dockerd[16869]: time="2019-12-17T14:39:57.045272056-05:00" level=info msg="stopping e Dec 17 14:39:57 w530 dockerd[16869]: failed to start daemon: Error initializing network controller: error Dec 17 14:39:57 ...
even though you appear to intend to use your setup with ROS at some point in the future, your current issue appears to be with Docker itself at the moment.
This makes it a non-ROS question, which would be better posted on more appropriate fora such as the Docker support forum.
I'm therefore closing your question here.
If it turns out there is a ROS-side to this question, you could edit it to update and we can see whether we should re-open.
Finally: if/when you post on another forum, please post a comment here with a link to your new post so we can keep things connected.
Just gonna link this repost on Reddit
As the Reddit post is already archived I will leave my answer here. Running a container while communicating in real-time seems to be possible in singularity 3.8. The only thing I had to do was export the
ROS_MASTER_URI
andROS_IP
environmental variables. Depending on your system you might have to use network virtualization.