由于树莓派的ARM架构原因,导致官方给的可执行文件无法使用,因而只能通过pip的方式进行安装
系统环境
- 树莓派4b 4G
- Ubuntu 20.04.1 LTS
- Linux rasp04 5.4.0-1015-raspi #15-Ubuntu SMP Fri Jul 10 05:34:24 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux
安装pip3
>>> sudo apt install python3-pip
安装libffi
>>> sudo apt install libffi-dev
如果不安装libffi,下一步会报错
arch64-3.8/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
15 | #include <ffi.h>
| ^~~~~~~
compilation terminated.
error: command 'aarch64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
安装docker-compose
>>> pip3 install docker-compose
添加路径到环境变量
# 将pi替换为你的名字
>>> vim ~/.zshrc
export PATH="${PATH}:/home/pi/.local/bin"
>>> source ~/.zshrc
测试
>>> docker-compose -v
docker-compose version 1.26.2, build unknown