树莓派-ubuntu安装docker和docker-compose
前言
提示:记住树莓派是arm架构,要更换下载源,一定要看自己的ubuntu版本号,我用的是Ubuntu20.04 LTS
提示:以下是本篇文章正文内容,下面案例可供参考
一、更换下载源
默认注释了源码仓库,如有需要可自行取消注释
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal main main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
# deb-src https://mirrors.ustc.edu.cn/ubuntu-ports/ focal-security main restricted universe multiversec
在执行sudo apt update 。
二、安装docker
curl -sSL https://get.daocloud.io/docker | sh
查看是否安装成功
docker version
这样就安装成功了。
三、安装docker-compose
因为docker-compose从官网安装不支持arm架构,所以要从pip安装。
第一步:安装pip
sudo apt-get install -y python python-pip
第二步:安装docker-compose
sudo pip install docker-compose
cd /usr/local/lib/python2.7/dist-packages
cp -r backports /usr/local/lib/python2.7/dist-packages/docker/transport/
第三步:拷贝文件:
cd /usr/local/lib/python2.7/dist-packages
cp -r backports /usr/local/lib/python2.7/dist-packages/docker/transport/
总结
If I have seen further, it is by standing on the shoulders of giants.