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

Why is "/tmp" restricted from being added to mounts? #571

Closed
dsharp-pivotal opened this issue Jan 20, 2022 · 1 comment
Closed

Why is "/tmp" restricted from being added to mounts? #571

dsharp-pivotal opened this issue Jan 20, 2022 · 1 comment
Labels
question Further information is requested

Comments

@dsharp-pivotal
Copy link

I'm attempting to use Colima as a replacement for Docker Desktop. We have existing scripts that mount paths in /tmp (-v /tmp/...). When I try to run colima start --mount /tmp, I see the error message:

> msg="errors inspecting instance: [field `mounts[1].location` must not be a system path such as /etc or /usr]"

Which comes from

return fmt.Errorf("field `mounts[%d].location` must not be a system path such as /etc or /usr", i)

I'm trying to understand this list of restricted system paths. I think I can understand safety concerns around /usr, /bin, /etc, /dev, etc, and security around /home. But I'm not sure why /tmp is restricted. Is this overly cautious, or is there a specific concern with /tmp?

I can bypass this check by mounting /private/tmp (because on MacOS, /tmp is a symlink to private/tmp), and when I do so, running docker containers with -v /private/tmp/... seems to work as expected. So my cursory testing doesn't indicate this is a technical restriction. I would prefer not to have to rewrite existing scripts to work around this.

@dsharp-pivotal
Copy link
Author

dsharp-pivotal commented Jan 20, 2022

I thought about it for 15 minutes and I think I figured it out... The mount would hide the system /tmp. This feature isn't just for mounting host paths in docker containers. The concerns are about the safety of the guest OS, not the host paths. I'll leave this here in case someone has the same question.

@AkihiroSuda AkihiroSuda added the question Further information is requested label Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants