ctr-crictl
使用crictl
命令之前,需要先配置 /etc/crictl.yaml 如下:
cat > /etc/crictl.yaml << EOF
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false
EOF
crictl info 查看 各种信息
ctr
ctr -n k8s.io images ls|grep nginx
显示本地镜像列表
docker images
ctr -n k8s.io images ls
下载镜像
docker pull
ctr -n k8s.io images pull -h
crictl pull unreachableg/registry.k8s.io_ingress-nginx_controller:v1.5.1
上传镜像 docker push ctr -n k8s.io images push -h *删除本地镜像 docker rmi ctr -n k8s.io delete 查看镜像详情 docker inspect IMAGE-ID crictl inspecti IMAGE-ID *导出离线镜像 docker save xxx > xxx.tar ctr -n k8s.io images export nginx-1.21.6.tar docker.io/library/nginx:1.21.6 *导入离线镜像 docker load -i xxx.tar ctr -n k8s.io images import xxx.tar
容器相关功能 Docker Containerd 显示容器列表 docker ps crictl ps 创建容器 docker create crictl create 启动容器 docker start crictl start 停止容器 docker stop crictl stop 删除容器 docker rm crictl rm 查看容器详情 docker inspect crictl inspect attach docker attach crictl attach exec docker exec crictl exec logs docker logs crictl logs stats docker stats crictl stats