skip to Main Content

What is the way to figure out what is the container runtime? Is it Kube/docker/podman etc?
Earlier there were ways to figure out like reading the content of "/run/systemd/container" file or by getting the env variable "container".

Looks like there were some changes done to docker & podman. Now the above methods no longer are telling us what is the container runtime.

Is there a way to determine the container runtime during container initialization itself?

2

Answers


  1. you can use this command to see what is your container runtime
    kubectl get nodes -o wide

    for more information you can check this link
    https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use/

    Login or Signup to reply.
  2. Try to read the .HostConfig.Runtime value inside the docker inspect output:

    docker inspect -f '{{ .HostConfig.Runtime }}' <container-name>
    

    If you want to do it on every container you have, type the command:

    docker inspect -f '{{ .HostConfig.Runtime }}' $(sudo docker ps -aq)
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search