This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
Running Kata Containers with the Clear Containers runtime
James O. D. Hunt edited this page Jan 26, 2018
·
7 revisions
- Assumptions
- Build and install Kata proxy
- Build and install Kata shim
- Build and install Clear Containers runtime for Kata
- Enable full debug
- Create an image
- Install the image
- Install guest kernel images
- Update Docker config
- Test
- You already have Clear Containers installed.
go get -d github.com/kata-containers/proxy
cd $GOPATH/src/github.com/kata-containers/proxy && make && sudo make install
go get -d github.com/kata-containers/shim
cd $GOPATH/src/github.com/kata-containers/shim && make && sudo make install
go get -d github.com/clearcontainers/runtime
cd $GOPATH/src/github.com/clearcontainers/runtime
make build-kata-system && sudo -E PATH=$PATH make install-kata-system
sudo sed -i -e 's/^# *\(enable_debug\).*=.*$/\1 = true/g' /usr/share/defaults/kata-containers/configuration.toml
go get -d github.com/kata-containers/agent
cd $GOPATH/src/github.com/kata-containers/agent && make
go get -d github.com/kata-containers/osbuilder
cd $GOPATH/src/github.com/kata-containers/osbuilder/rootfs-builder
script -fec 'sudo -E GOPATH=$GOPATH USE_DOCKER=true ./rootfs.sh clearlinux'
Note:
- You must ensure that the default Docker runtime is
runc
to make use of theUSE_DOCKER
variable. If that is not the case, simply remove the variable from the command above.
sudo install -o root -g root -m 0755 -t rootfs/bin ../../agent/kata-agent
sudo install -o root -g root -m 0444 ../../agent/kata-agent.service rootfs/usr/lib/systemd/system/
sudo install -o root -g root -m 0444 ../../agent/kata-containers.target rootfs/usr/lib/systemd/system/
cd $GOPATH/src/github.com/kata-containers/osbuilder/image-builder
script -fec 'sudo -E USE_DOCKER=true ./image_builder.sh ../rootfs-builder/rootfs'
Note:
- You must ensure that the default Docker runtime is
runc
to make use of theUSE_DOCKER
variable. If that is not the case, simply remove the variable from the command above.
commit=$(git log --format=%h -1 HEAD)
date=$(date +%Y-%m-%d-%T.%N%z)
image="kata-containers-${date}-${commit}"
sudo install -o root -g root -m 0640 -D kata-containers.img "/usr/share/kata-containers/${image}"
(cd /usr/share/kata-containers && sudo rm -f kata-containers.img && sudo ln -s "$image" kata-containers.img)
sudo ln -s /usr/share/clear-containers/vmlinux.container /usr/share/kata-containers/
sudo ln -s /usr/share/clear-containers/vmlinuz.container /usr/share/kata-containers/
sudo sed -i 's!^\(ExecStart=[^$].*$\)!\1 --add-runtime kata-runtime=/usr/local/bin/kata-runtime!g' /etc/systemd/system/docker.service.d/clear-containers.conf
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker run -ti --runtime kata-runtime busybox sh
Usage
Development
Process