Oh apologies, I had thought the docker interface might be implicit on classic systems… I wonder if it would make sense to update the docker interface in snapd so that it could be implicit on classic systems when the docker socket is already present - something like:
diff --git a/interfaces/builtin/docker.go b/interfaces/builtin/docker.go
index 07ba6705b2..0fc07b8e57 100644
--- a/interfaces/builtin/docker.go
+++ b/interfaces/builtin/docker.go
@@ -19,6 +19,8 @@
package builtin
+import "github.com/snapcore/snapd/osutil"
+
const dockerSummary = `allows access to Docker socket`
const dockerBaseDeclarationSlots = `
@@ -51,5 +53,6 @@ func init() {
baseDeclarationSlots: dockerBaseDeclarationSlots,
connectedPlugAppArmor: dockerConnectedPlugAppArmor,
connectedPlugSecComp: dockerConnectedPlugSecComp,
+ implicitOnClassic: osutil.FileExists("/var/run/docker.sock") || osutil.FileExists("/run/docker.sock"),
})
}
(but then I expect this would get tripped up if a docker snap was installed since it would be providing this socket at the same path - so it might need more extensive checks…)
I am not aware of other snaps (that plug docker) wanting / needing this access so I am surprised we haven’t encountered this kind of request before (ie. for a snap needing access to the docker socket of a non-snapped docker). How common do you think this use-case is? Would most users just use the docker snap instead?