ARM64已经成为手机上的主流,而且开始进入服务器领域(中国的全志、辉腾等芯片也都是ARM架构),很多开发板也相继推出。为了充分发挥其能力,我希望能在上面运行Docker。但是,目前虽然ARM32上面已经有多个Docker移植版本,但是ARM64上找不到现成的(96Boards的系统包含的Docker无法使用),需要自己编译(Docker官网已经包含编译支持)。下面是一些找到的资源,先抓下来,后面再慢慢测试。
在96Board上编译,注意:
更新源,运行:sudo apt update
安装Docker,运行: sudo apt install docker-engine
让Docker在用户空间运行:sudo usermod -aG docker linaro
1G内存的CE版96Board在编译go时会出现“can't allocate memory”错误,参考这里添加虚存解决:https://my.oschina.net/u/2306127/blog/657269
编译之前不要运行 sudo apt upgrade,因为目前docker源只有1.9.1版本,如果系统其它裤更新到了新版,可能导致Docker无法运行。在编译安装完新版Docker(1.12以后版本)后,再去更新系统。
我按照DieterReuter的方法进行编译(直接在host中编译),后来出现内存分配失败退出。然后直接进入~/home/src/docker里面运行 make deb 编译,这是在docker容器里面编译的。
首先获取脚本代码:
git clone https://github.com/DieterReuter/arm64-docker-builder.git
下面是来自于DieterReuter的编译指南(是针对Qemu中虚拟机的):
arm64-docker-builder
This repo contains all necessary details and scripts how to compile Docker on an ARM64 (or AARCH64) machine which is running Ubuntu 15.04. This works well, even in a QEMU emulated AARCH64 machine with an Ubuntu 15.04 Cloud Image for ARM64. I've tested all these steps with a QEMU box which could be run with the help of vagrant in VirtualBox or on DigitalOcean with the following repo https://github.com/DieterReuter/qemu-arm-box.
Background
For the last six months or so, I was working hard in my spare time to get Docker running e