RunV安装配置

最近在学习了解Kata相关技术,纪录下RunV的安装过程

安装Golang

官方安装文档

安装RunV

# 安装依赖
sudo apt-get install -y autoconf automake pkg-config libdevmapper-dev libvirt-dev libvirt-bin wget libaio1 libpixman-1-0 jq qemu-system-x86 qemu

# 安装 hyperstart
git clone https://github.com/hyperhq/hyperstart.git ${GOPATH}/src/github.com/hyperhq/hyperstart
cd ${GOPATH}/src/github.com/hyperhq/hyperstart
./autogen.sh && ./configure && make
sudo mkdir -p /var/lib/hyper/
sudo cp build/hyper-initrd.img build/arch/x86_64/kernel /var/lib/hyper

# 安装 runv
git clone https://github.com/hyperhq/runv $GOPATH/src/github.com/hyperhq/runv
cd $GOPATH/src/github.com/hyperhq/runv
./autogen.sh && ./configure --without-xen && make && make install

Run with Docker

安装最新docker

笔者测试docker版本为: 17.07.0-ce

curl -sSL https://get.docker.com/ | bash
mkdir -p /etc/docker
cat >/etc/docker/daemon.json <<EOF
{
  "default-runtime": "runv",
  "runtimes": {
    "runv": {
      "path": "runv"
    }
  }
}
EOF

运行docker

# 测试通过命令行启动Docker
# 停止Docker
systemctl stop docker
# 终端启动
docker-containerd --debug -l unix:///var/run/docker/libcontainerd/docker-containerd.sock \
   --runtime /usr/local/bin/runv --runtime-args --debug --runtime-args --driver=libvirt \
   --shim /usr/bin/docker-containerd-shim \
   --runtime-args --kernel=/var/lib/hyper/kernel \
   --runtime-args --initrd=/var/lib/hyper/hyper-initrd.img \
   --start-timeout 2m
# 终端启动
dockerd -l debug --containerd=/var/run/docker/libcontainerd/docker-containerd.sock

测试

docker run --rm -it busybox sh
# 通过ps aux|grep qemu可以看到有一个hyper相关进程说明配置成功!

你可能感兴趣的:(docker,runv)