From 0150d3abf265db2767832c8126f65865d81cbdaa Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Fri, 12 Feb 2021 08:33:42 +0100 Subject: [PATCH] Delete kata container after install --- docker-install-all.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docker-install-all.sh b/docker-install-all.sh index 0f05b9b..3be0253 100755 --- a/docker-install-all.sh +++ b/docker-install-all.sh @@ -30,10 +30,15 @@ mempercore=$(((mem/1024-4096)/cores)) if ! docker info 2>/dev/null|grep Runtimes:|grep -qs kata-qemu-virtiofs; then echo "Installing kata...." cid=$(docker run -d --runtime=runc -v /opt/kata:/opt/kata -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd -v /etc/docker:/etc/docker -it katadocker/kata-deploy kata-deploy-docker install) + # wait for finish while [ "$(docker container inspect -f '{{.State.Running}}' "$cid")" == "true" ]; do sleep 1 done + + # delete container + docker rm $cid + # update default container CPU and memory sed -i "s/default_vcpus = .*/default_vcpus = 2/g;s/default_memory = .*/default-memory = $mempercore/g" /opt/kata/share/defaults/kata-containers/configuration-qemu-virtiofs.toml echo "Kata installed"