Skip to content

alpine linux can't run docker, docker socket permission denied #1470

Answered by jandubois
cayspekko asked this question in Q&A
Discussion options

You must be logged in to vote

I assume you meant addgroup instead of useradd.

The reason the new group is not reflected in ssh sessions is that limactl shell is not establishing a new session in the VM, but re-using a "master control socket". Running sudo inside the VM starts a new session, and the new group membership will be effective.

The easiest way to get around this is to stop and restart the VM. Then the new group assignment should work properly:

$ limactl shell alpine sudo addgroup $USER docker
$ limactl shell alpine id
uid=501(jan) gid=1000(jan) groups=1000(jan)
$ limactl stop alpine
[...]
$ limactl start alpine
[...]
$ limactl shell alpine id
uid=501(jan) gid=1000(jan) groups=101(docker),1000(jan)

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@afbjorklund
Comment options

@cayspekko
Comment options

Answer selected by cayspekko
Comment options

You must be logged in to vote
2 replies
@cayspekko
Comment options

@jandubois
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants