Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extension to support docker from docker #269

Open
tfoote opened this issue Mar 4, 2024 · 2 comments
Open

Add extension to support docker from docker #269

tfoote opened this issue Mar 4, 2024 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tfoote
Copy link
Collaborator

tfoote commented Mar 4, 2024

Not Docker in Docker but mounting the docker socket inside to enable calling the host daemon from inside

Following https://stackoverflow.com/a/33003273/604099

I've tested it working manually with just the docker socket mount.

rocker --volume /var/run/docker.sock:/var/run/docker.sock -- ros:rolling

@tfoote tfoote added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 4, 2024
@miguelprada
Copy link
Contributor

I've been using this approach for some time without much issue in my extension. Note that one also installs the docker CLI inside the container, which may or may not be a desired feature.

One thing one needs to be somewhat careful about when doing this is bind mounts. Since the daemon is running on the host, you can only bind mount folders from the host filesystem, not folders from the filesystem inside the container. This has already bitten me a couple of times until I realized what was going on.

@tfoote
Copy link
Collaborator Author

tfoote commented Mar 5, 2024

Thanks for the validation and warnings. Those are good insights about the mounting restrictions. I wonder if there's a way to help make that more visible when inside. And installing docker into the container is defintely a good idea if possible.

As well the docker group pass through would be good to do automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants