Skip to content

permissions of docker #69

Open
Open

Description

@Spuxy

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")
}

Activity

  1. jacobtomlinson commented on Oct 18, 2024

    @jacobtomlinson
    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.

  2. Spuxy commented on Oct 21, 2024

    @Spuxy
    Author

    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.

  3. jacobtomlinson commented on Oct 24, 2024

    @jacobtomlinson
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions