docker镜像管理

发布于 2023-11-29  538 次阅读


搜索镜像

[root@localhost ~]# docker search centos
NAME                               DESCRIPTION                                      STARS     OFFICIAL   AUTOMATED
centos                             DEPRECATED; The official build of CentOS.        7681      [OK]
kasmweb/centos-7-desktop           CentOS 7 desktop for Kasm Workspaces             41
bitnami/centos-base-buildpack      Centos base compilation image                    0                    [OK]
datadog/centos-i386                                                                 0
dokken/centos-7                    CentOS 7 image for kitchen-dokken                5
dokken/centos-8                    CentOS 8 image for kitchen-dokken                5
spack/centos7                      CentOS 7 with Spack preinstalled                 1
dokken/centos-6                    EOL: CentOS 6 image for kitchen-dokken           0
atlas/centos7-atlasos              ATLAS CentOS 7 Software Development OS           0
spack/centos6                      CentOS 6 with Spack preinstalled                 1
ustclug/centos                     Official CentOS Image with USTC Mirror           0
dokken/centos-stream-8                                                              4
eclipse/centos_jdk8                CentOS, JDK8, Maven 3, git, curl, nmap, mc, …   5                    [OK]
adoptopenjdk/centos7_build_image                                                    1
dokken/centos-stream-9                                                              8
corpusops/centos-bare              https://github.com/corpusops/docker-images/      0
corpusops/centos                   centos corpusops baseimage                       0
adoptopenjdk/centos6_build_image                                                    0
eclipse/centos_go                  Centos + Go                                      0                    [OK]
fnndsc/centos-python3              Source for a slim Centos-based Python3 image…   0                    [OK]
spack/centos-stream                                                                 2
eclipse/centos_spring_boot         Spring boot ready image based on CentOS          0                    [OK]
openmicroscopy/centos-systemd-ip   centos/systemd with iproute, for testing mul…   0                    [OK]
eclipse/centos                     CentOS based minimal stack with only git and…   1                    [OK]
eclipse/centos_nodejs              CentOS based nodejs4 stack                       0                    [OK]

拉取镜像

docker pull nginx:latest
#镜像名:tag
#tag就是镜像的版本,不填默认是最新版latest

查看镜像

docker images
docker inspect centos #查看镜像的详细信息

列出镜像各层创建信息

docker history nginx:latest

镜像的导入与导出

导出

docker save centos:latest > /root/mycentos.tar.gz

导入

docke load < /root/mycentos.tar.gz

删除镜像

docker images 查看镜像
docker rmi 镜像名/id
docker rmi -f `docker images -qa` #删除所有镜像
  • alipay_img
  • wechat_img
一朝风月,万古长空
最后更新于 2023-11-29