安装/移除Docker镜像
确认可使用的Docker镜像。
搜索可安装的映像
官方映像搜索网站
$ docker 搜索 XXX
$ sudo docker search centos
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
centos The official build of CentOS. 7243 [OK]
kasmweb/centos-7-desktop CentOS 7 desktop for Kasm Workspaces 21
continuumio/centos5_gcc5_base 3
dokken/centos-7 CentOS 7 image for kitchen-dokken 2
dokken/centos-stream-9 1
couchbase/centos7-systemd centos7-systemd images with additional debug… 1 [OK]
spack/centos7 CentOS 7 with Spack preinstalled 1
datadog/centos-i386 0
dokken/centos-8 CentOS 8 image for kitchen-dokken 0
dokken/centos-6 CentOS 6 image for kitchen-dokken 0
2. 下载Docker镜像
拉取镜像 XXX
$ sudo docker pull centos
Using default tag: latest
latest: Pulling from library/centos
a1d0c7532777: Pull complete
Digest: sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
Status: Downloaded newer image for centos:latest
docker.io/library/centos:latest
确认Docker镜像。
列出Docker镜像。
$ sudo docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
centos latest 5d0da3dc9764 10 months ago 231MB
删除Docker镜像
删除Docker镜像XXX。
$ sudo docker image rm -f centos
Untagged: centos:latest
Untagged: centos@sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177
Deleted: sha256:5d0da3dc976460b72c77d94c8a1ad043720b0416bfc16c52c45d4847e53fadb6