1、镜像治理命令

1、查看以后的镜像[root@node1 wordpress]# docker imagesREPOSITORY     TAG            IMAGE ID       CREATED         SIZEnginx          v1             a80567189207   6 days ago      141MBbjbfd/nginx    latest         605c77e624dd   17 months ago   141MBbjbfd/nginx    v1             605c77e624dd   17 months ago   141MBnginx          latest         605c77e624dd   17 months ago   141MBwordpress      latest         c3c92cc3dcb1   17 months ago   616MBmariadb        10.6.4-focal   12e05d5da3c5   19 months ago   409MBbjbfd/stress   latest         89e5b79daa74   7 years ago     215MB2、查看image命令[root@node1 wordpress]# docker image --helpUsage:  docker image COMMANDManage imagesCommands:  build       Build an image from a Dockerfile  history     Show the history of an image  import      Import the contents from a tarball to create a filesystem image  inspect     Display detailed information on one or more images  load        Load an image from a tar archive or STDIN  ls          List images  prune       Remove unused images  pull        Download an image from a registry  push        Upload an image to a registry  rm          Remove one or more images  save        Save one or more images to a tar archive (streamed to STDOUT by default)  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGERun 'docker image COMMAND --help' for more information on a command.3、下载镜像(新增)[root@node1 wordpress]# docker pull nginxUsing default tag: latestlatest: Pulling from library/nginxDigest: sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31Status: Downloaded newer image for nginx:latestdocker.io/library/nginx:latest阐明 :  nginx : 镜像名 latest : 镜像版本4、查看镜像列表(列表查问)docker images等同docker image ls[root@node1 wordpress]# docker image lsREPOSITORY     TAG            IMAGE ID       CREATED         SIZEbjbfd/nginx    latest         605c77e624dd   17 months ago   141MBbjbfd/nginx    v1             605c77e624dd   17 months ago   141MBnginx          latest         605c77e624dd   17 months ago   141MBwordpress      latest         c3c92cc3dcb1   17 months ago   616MBmariadb        10.6.4-focal   12e05d5da3c5   19 months ago   409MBbjbfd/stress   latest         89e5b79daa74   7 years ago     215MB阐明 :REPOSITORY : 示意镜像的仓库源TAG : 镜像的标签IMAGE ID : IDCREATED : 镜像创立事件SIZE : 镜像大小5、查看镜像列表(列表查问)

删除所有正在运行的容器
docker rm -f $(docker ps -a -q)