Error: snap "core" has no "docker" interface slots

$ sudo snap connect _snap_name_:docker
error: snap "core" has no "docker" interface slots

Any ideas?

$ snap version
snap    2.44.1
snapd   2.44.1
series  16
ubuntu  18.04
kernel  5.3.0-18-generic

This is because the docker interface is not (yet) implicit, so you need to have the docker interface provided by the docker snap today. I.e.

$ snap install docker
$ snap stop --disable docker.dockerd # only necessary if you wanted to use non-snap docker from your snap
$ snap connect your-snap:docker docker:docker-daemon

There have been some discussions about making the docker interface implicit, in which case you would be able to connect the interface to the system snap (i.e. core or snapd), but the issue there we need to sort out is what happens when the docker snap is installed and that is providing the slot too.

1 Like

Does that mean that I can’t make the snap to interact with non-snap Docker distribution?

UPDATE: Oh I noticed the second step.

I hope to do this for snapd 2.45.

1 Like

I’ve added the following code to the launcher as a mitigation:

if ! snapctl is-connected docker; then
    printf "Warning: You haven't connected the snap to the \`docker\` interface, the application may not be able to interact with the local Docker service.  Refer <https://forum.snapcraft.io/t/error-snap-core-has-no-docker-interface-slots/16322/2> for instructions.\\n\\n" 1>&2
fi