硬件:Raspberry Pi 4B(4g或8g版本)
系统:Ubuntu 20.04 LTS
- 安装docker
(
cat <<EOF
deb [arch=arm64] https://download.docker.com/linux/ubuntu bionic stable
EOF
) > /etc/apt/sources.list.d/docker.list
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
apt update && apt -y install docker-ce=5:18.09.9~3-0~ubuntu-bionic docker-ce-cli=5:18.09.9~3-0~ubuntu-bionic containerd.io
`apt update && apt -y` `install` `docker-ce=5:18.09.9~3-0~ubuntu-bionic docker-ce-cli=5:18.09.9~3-0~ubuntu-bionic containerd.io`
- docker配置文件
(
cat <<EOF
{
"registry-mirrors": ["https://ai6ce1da.mirror.aliyuncs.com"],
"exec-opts": ["native.cgroupdriver=systemd"],
"storage-driver": "overlay2",
"storage-opts": [
"overlay2.override_kernel_check=true"
]
}
EOF
) > /etc/docker/daemon.json
- 配置系统启动参数,禁用ipv6,启用 cgroup
sed -i 's/$/ ipv6.disable=1 cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 /g' /boot/firmware/cmdline.txt
- 重新启动树莓派
reboot
- 启动后查看docker版本号
Client:
Version: 18.09.9
API version: 1.39
Go version: go1.11.13
Git commit: 039a7df
Built: Wed Sep 4 16:54:30 2019
OS/Arch: linux/arm64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.9
API version: 1.39 (minimum version 1.12)
Go version: go1.11.13
Git commit: 039a7df
Built: Wed Sep 4 16:21:47 2019
OS/Arch: linux/arm64
Experimental: false
参考
来源:oschina
链接:https://my.oschina.net/fastjrun/blog/4310609