cri-dockerd icon indicating copy to clipboard operation
cri-dockerd copied to clipboard

Does not work if there is no `docker` group

Open MikeSpreitzer opened this issue 2 years ago • 9 comments

I just installed Ubuntu 22.04 server on a new VM. The install process offered to "install" "docker", and I took the offer. Later I found out this install was done with snap. It turns out that snap install docker, at least on Ubuntu 22.04, does NOT create a usergroup named docker. But the cri-docker.socket systemd unit here assumes the existence of such a group.

MikeSpreitzer avatar May 04 '22 18:05 MikeSpreitzer

I don't think it has been tested with anything, except for the regular installation from a deb.

https://docs.docker.com/engine/install/ubuntu/

It might be supported with "docker.io", not sure ? (system, as in sudo apt install docker.io)

https://packages.ubuntu.com/jammy/docker.io

afbjorklund avatar May 06 '22 05:05 afbjorklund

If it comes to it, it would be possible to remove "cri-docker.socket" and modify "cri-docker.service" to run without it.

Requires=cri-docker.socket

ExecStart=/usr/bin/cri-dockerd --container-runtime-endpoint fd:// --network-plugin=

That would make cri-dockerd start on boot, and not on demand, but might work better with odd docker installations.

afbjorklund avatar May 06 '22 05:05 afbjorklund

This is probably something to speak to the snap maintainer about. How do users get permissions to run docker commands with the snap?

evol262 avatar May 24 '22 21:05 evol262

@evol262 Good point. That's an issue you can raise over at snap

folarinmartins avatar Jun 24 '22 22:06 folarinmartins

FYI this happened to me as well on ubuntu 20.04, I had to add group docker (no snap installation)

criscola avatar Apr 05 '23 08:04 criscola

How did you install docker? The (deb) packages should have added the "docker" group

afbjorklund avatar Apr 05 '23 09:04 afbjorklund

Should have mentioned I didn't yet install it :) probably makes sense to do that before installing the cri.

criscola avatar Apr 05 '23 09:04 criscola

It seems that the cri-dockerd packages have a dependency on containerd instead of dockerd...

afbjorklund avatar Apr 05 '23 09:04 afbjorklund

Yes, they do, which is typically provided by docker. The reason there isn't a dependency on Docker is that there is no metapackage/requirement shared by docker-ce/docker-ee/docker-io/etc. We could at least create the group if it isn't present, because cri-docker.service depends on docker.service (which is consistent across packages), which still provides a runtime dependency.

evol262 avatar Apr 05 '23 21:04 evol262