doctl 无法找到 docker 二进制文件

doctl is unable to find docker binary

配置数字海洋容器注册表

link : https://www.digitalocean.com/docs/kubernetes/how-to/set-up-registry/

After Successfully : Snap install doctl

#doctl regitry login
Error : unable to Find Docker binary . make sure docker is installed 

#docker --version 
Docker version 18.09.2, build 6247962

Github 问题:https://github.com/digitalocean/doctl/issues/709

Problem

doctl 无法找到 docker 因为 snap 二进制路径是 /usr/snap/bin docker 二进制路径是 /usr/local/bin/

所以他们之间的联系不知何故被打破了

THIS IS MY CUSTOM SOLUTION TO MAKE IT WORK :

第 1 步:卸载 doctl 并刷新环境路径

#sudo snap remove doctl

第 2 步:使用最新包安装 docl

wget https://github.com/digitalocean/doctl/releases/download/v1.17.0/doctl-1.17.0-linux-amd64.tar.gz
curl -sL https://github.com/digitalocean/doctl/releases/download/v1.38.0/doctl-1.38.0-linux-amd64.tar.gz | tar -xzv
sudo mv ~/doctl /usr/local/bin

(可选)步骤 ? : 修复路径问题 如果未找到 doctl,则使用 Symbolic Link

修复它

ln -s /usr/local/bin/doctl /usr/snap/doctl

Step-3 : 运行 docker 登录命令

#doctl registry login

**IF getting error related to x11 then run command below and try Step-3 **

sudo apt update 
sudo apt -V install gnupg2 pass

#doctl registry login

login successfully