树莓派安装docker

安装docker需要的依赖

1
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common

添加docker源

1
2
curl -fsSL https://download.docker.com/linux/raspbian/gpg | sudo apt-key add -
echo "deb [arch=armhf] https://download.docker.com/linux/raspbian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list

更新源

1
sudo apt update

安装docker

1
sudo apt install docker-ce

查看是否安装成功

1
sudo docker --version

设置docker国内镜像

1
sudo nano /etc/docker/daemon.json

添加如下内容

1
2
3
{
"registry-mirrors": ["https://registry.docker-cn.com"]
}

重启docker

1
sudo systemctl restart docker.service

开机启动

1
sudo systemctl enable docker.service

报错

无uuid

image-20220110105524516

1
sudo apt-get install uuid-runtime

无ifconfig

1
apt-get update//ifconfig apt-get install net-tools //pingapt-get install iputils-ping