pachadotdev / analogsea

Digital Ocean R client
https://pacha.dev/analogsea/
Apache License 2.0
154 stars 24 forks source link

non-root user should be able to run docker #78

Closed wch closed 9 years ago

wch commented 9 years ago

For example, with the "ubuntu" config, the analogsea user can't do anything with docker:

d <- droplet_create('test', image = 'docker', cloud_config = 'ubuntu')

droplet_ssh(revdep, user="analogsea", "docker run --rm rocker/r-base R --version")
#2014/10/21 21:01:25 Post http:///var/run/docker.sock/v1.15/containers/create: dial unix /var/run/docker.sock: permission denied
# Error: ssh failed

These commands need to be run first:

droplet_ssh(user = "analogsea", 
    "sudo gpasswd -a analogsea docker",
    "sudo service docker restart")

# Now this works
droplet_ssh(revdep, user="analogsea", "docker run --rm rocker/r-base R --version")
hadley commented 9 years ago

Maybe this should go in a cloud config file?

wch commented 9 years ago

Fixed in 14e86fbcd5ef4d00e1464881e31231bcaaa160e1.