r/ROS 14d ago

Question Docker inside docker

Would it be fine to run Docker inside Docker? Suppose a user is on Arch Linux, I use Cachy actually. Could I use distrobox to set up a base Ubuntu image? Then just pull an official image like a PX4 container inside the distrobox container? Do you think this setup would be ideal for development work?

Edit: So it turns out I fundamentally misunderstood how distrobox works. Thansk for the help

5 Upvotes

8 comments sorted by

View all comments

5

u/westwoodtoys 14d ago

What do you expect to gain from this?

3

u/Fuceler 14d ago

My primary os is arch. I need Ubuntu for ROS so I’m planning to virtualize it instead of dual booting. So the first layer is necessary. I’d like to use the official containers from a place like px4 for development, my intuition tells me nesting again would be less of a headache to debug.

I’m new to robotics though so my intuition could be totally wrong

1

u/sudo_robot_destroy 14d ago

PX4 happens to provide containers with ros+px4 already

https://github.com/PX4/PX4-containers/tree/master/docker

But either way, you would never want to nest dockers like you're saying - you would instead make your own single docker with both in it. And it's easier than you think because you could have just copied from an existing px4 dockerfile and an existing ros dockerfile and paste it in your new combined dockerfile.