Migrate Clear Containers to Kata Containers*

This tutorial explains how to migrate from Clear Containers to Kata Containers.

Description

Clear Containers and Kata Containers can co-exist in the same system. Both can be installed through the containers-virt bundle. However, we recommend that you migrate to Kata Containers because Clear Containers is no longer maintained and will soon be deprecated on Clear Linux* OS.

Prerequisites

  • Clear Containers is on a Docker* system.

  • Kata Containers is installed. See Kata Containers*.

Stop Clear Containers instances

As an unprivileged user, stop all running instances of Clear Containers:

for container in $(sudo docker ps -q); do sudo docker stop $container; done

Manually migrate customized configuration files

If you have made changes to your Clear Containers configuration, review those changes and decide whether to manually apply those changes to your Kata Containers configuration.

Make any required changes before continuing this process.

Note

You do not need to manually remove any Clear Containers packages.

Enable Kata Containers as default

  1. Configure Docker to use the Kata Containers runtime by default.

    sudo mkdir -p /etc/systemd/system/docker.service.d/
    cat <<EOF | sudo tee /etc/systemd/system/docker.service.d/51-runtime.conf
    [Service]
    Environment="DOCKER_DEFAULT_RUNTIME=--default-runtime kata-runtime"
    EOF
    
  2. Restart the Docker systemd services.

    sudo systemctl daemon-reload
    sudo systemctl restart docker
    
  3. Verify Docker is using Kata Containers.

    sudo docker info | grep -i 'default runtime'
    Default Runtime: kata-runtime
    

Run Kata Containers

Use the following command:

sudo docker run -ti busybox sh

Congratulations!

You’ve successfully migrated from Clear Containers to Kata Containers.