Ok, this is a good error to debug, and I know exactly what's wrong: Did you install docker with Ubuntu or with YAMS?
If you installed it with Ubuntu, then you installed the Snap version which will not work with YAMS. Snaps run in a sandbox mode and don't have privileged access to the OS. The fix for this is to uninstall the Snap version of docker and install the one that comes with YAMS.