1. 程式人生 > >Docker映象(二)

Docker映象(二)

映象命令操作

docker search 到映象倉庫搜尋映象
docker search centos

 

docker images 檢視本地已有的映象
[[email protected] ~]# docker images
REPOSITORY                      TAG                 IMAGE ID            CREATED             SIZE
centos-vim-dockerfile           latest              f39351a5d35c        30
hours ago 355MB mysql 5.7 1b30b36ae96a 3 days ago 372MB mysql latest ee1e8adfcefb 3 days ago 484MB nginx latest dbfc48660aeb 3 days ago 109MB

 

docker save 匯出映象
[[email protected] ~]# docker save -o nginx.tar nginx
[[email protected]-server ~]# ls
anaconda-ks.cfg  docker_login.sh    nginx.tar
[[email protected]-server ~]# 

 

docker load --input 匯入映象
[[email protected] ~]# docker load --input nginx.tar
Loaded image: nginx:latest

 

docker rmi 刪除映象
[[email protected] ~]# docker rmi f39351a5d35c
Untagged: centos-vim-dockerfile:latest
Deleted: sha256:f39351a5d35ca9e00dc101c43464c3f55e9e08a240daaafc4eded43692f745fb
Deleted: sha256:f1b1df6c5b8314f3a0b3a1d5a6a96d7f20501f770b042ac1ad18b6f84164cabc