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

permissions of docker #69

Open
Spuxy opened this issue Oct 17, 2024 · 3 comments
Open

permissions of docker #69

Spuxy opened this issue Oct 17, 2024 · 3 comments

Comments

@Spuxy
Copy link

Spuxy commented Oct 17, 2024

Do we really need to check this permission by docker ps ? And what does it mean by root privileges ? The exec command can return any exit code, which doesnt need to be just privileges.

if _, err := exec.Command("docker", "ps").Output(); err != nil {
	return errors.New("Docker requires root privileges to run")
}
@jacobtomlinson
Copy link
Member

I think that error needs updating to say something like You need permission to run the docker command, the check here is just that you are able to use the docker CLI because canary will call this under the hood.

@Spuxy
Copy link
Author

Spuxy commented Oct 21, 2024

Great ! But maybe we could go further and check this better way ? eg. check that the process was executed under uid/guid and we can check, that if he has the group docker as upstream's doc of docker recommend.

This exec.Command runs the sh (or variant of shell) command and the os.Exit can be anything not just permission.

@jacobtomlinson
Copy link
Member

I would be very happy to change this check to something more robust. If you have ideas of how things can be done better please feel free to make a Pull Request with your suggestion and ping me for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants