镜像相关命令
搜索镜像
$ docker search --limit 1 --filter=stars=10 hello-world
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
hello-world Hello World! 1154 [OK]
下载镜像
$ docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest
列出镜像
$ docker images hello*
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest fce289e99eb9 14 months ago 1.84kB
删除镜像
$ docker rmi hello-world
Untagged: hello-world:latest
Untagged: hello-world@sha256:f9dfddf63636d84ef479d645ab5885156ae030f611a56f3a7ac7f2fdd86d7e4e
Deleted: sha256:fce289e99eb9bca977dae136fbe2a82b6b7d4c372474c9235adc1741675f587e
Deleted: sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
保存镜像
$ docker save hello-world > hello-world.tar
加载镜像
$ docker load < hello-world.tar
af0b15c8625b: Loading layer [==================================================>] 3.584kB/3.584kB
L