aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-md9kAN/python2.7-2.7.16=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python2.7 -c c/_cffi_backend.c -o build/temp.linux-aarch64-2.7/c/_cffi_backend.o
c/_cffi_backend.c:15:10: fatal error: ffi.h: No such file or directory
#include
^~~~~~~
compilation terminated.
error: command ‘aarch64-linux-gnu-gcc’ failed with exit status 1
- 用pip安装docker-compose:
pip install docker-compose
- 将python2.7的dist-packages文件夹复制到docker的工作目录下:
cd /usr/local/lib/python2.7/dist-packages && \
cp -r backports /usr/local/lib/python2.7/dist-packages/docker/transport/
如果不执行此操作,接下来在执行docker-compose命令的时候会报错,提示找不到名为ssl_match_hostname的module,错误信息如下:
File “/usr/local/lib/python2.7/dist-packages/docker/tls.py”, line 5, in
from .transport import SSLHTTPAdapter
File “/usr/local/lib/python2.7/dist-packages/docker/transport/init.py”, line 3, in
from .ssladapter import SSLHTTPAdapter
File “/usr/local/lib/python2.7/dist-packages/docker/transport/ssladapter.py”, line 23, in
from backports.ssl_match_hostname import match_hostname
ImportError: No module named ssl_match_hostname
- 此时已经安装成功了,执行命令docker-compose version试试:
root@raspbian:~# docker-compose version
docker-compose version 1.24.1, build 4667896
docker-py version: 3.7.3
CPython version: 2.7.16
OpenSSL version: OpenSSL 1.1.1c 28 May 2019
至此,在64位操作系统上安装docker-compose已经成功,希望您在安装的时候,本文能给您一些参考;
为什么不用官方的安装方式
无论何时,官方的安装方法都是首选,那么本文为何要自己折腾这么多步骤呢?
- 我们来看下官方安装docker-compose的步骤,地址是:https://docs.docker.com/compose/install/ ,第一步是下载:
sudo curl -L “https://github.com/docker/compose/releases/download/1.24.1/docker-compose-( u n a m e − s ) − (uname -s)-(uname−s)−(uname -m)” -o /usr/local/bin/docker-compose