Docker 鏡像操作常用命令
(1)、搜索鏡像(在dockerhub倉庫中查找centos的鏡像)
[root@localhost docker]#docker search centos
找出一堆centos鏡像

鏡像的結構: registry_name/repository_name/image_name:tag_name
列如: docjer.io/library/alpine:3.10.1
(2)、鏡像 下載、查看、打標簽、推送
[root@localhost docker]#docker pull Nginx (不指定版本下載的話,默認下載最新的latest)

也可以指定版本下載:
[root@localhost ~]# docker pull nginx:1.16 下載Nginx1.16 版本

還可以寫全下載
[root@localhost ~]# docker pull docker.io/library/nginx:1.16
查看本地鏡像
[root@localhost ~]# docker images 或者 [root@localhost ~]# docker image ls

鏡像打標簽
[root@localhost ~]# docker tag nginx:1.16 nginx:local
可以看到多了一個鏡像名,且標簽名為local

如果要把打標簽的鏡像上傳到dockerhub上 就要嚴格遵守鏡像的格式要求:
[root@localhost ~]# docker tag nginx:latest docker.io/feixiangkeji974907/nginx:myfirst
這里的feixiangkeji974907 要和 用戶名一樣

推送鏡像
[root@localhost ~]# docker push docker.io/feixiangkeji974907/hello-world:test


刪除標簽
[root@localhost ~]# docker rmi docker.io/fxkj/alpine:latest
刪除鏡像(加INAME ID )
[root@localhost ~]# docker rmi fce289e99eb9
Error response from daemon: conflict: unable to delete fce289e99eb9 (must be forced) – image is being used by stopped container 3c431d073dc1
[root@localhost ~]# docker rmi -f fce289e99eb9 #-f 強制刪除
查看鏡像制作歷史、查看鏡像底層信息
[root@localhost ~]#docker history centos7:laster
[root@localhost ~]# docker inspect nginx:laster
docker 鏡像操作常用命令
(1)、搜索鏡像(在dockerhub倉庫中查找centos的鏡像)
[root@localhost docker]#docker search centos
找出一堆centos鏡像

鏡像的結構: registry_name/repository_name/image_name:tag_name
列如: docjer.io/library/alpine:3.10.1
(2)、鏡像 下載、查看、打標簽、推送
[root@localhost docker]#docker pull nginx (不指定版本下載的話,默認下載最新的latest)

也可以指定版本下載:
[root@localhost ~]# docker pull nginx:1.16 下載Nginx1.16 版本

還可以寫全下載
[root@localhost ~]# docker pull docker.io/library/nginx:1.16
查看本地鏡像
[root@localhost ~]# docker images 或者 [root@localhost ~]# docker image ls

鏡像打標簽
[root@localhost ~]# docker tag nginx:1.16 nginx:local
可以看到多了一個鏡像名,且標簽名為local

如果要把打標簽的鏡像上傳到dockerhub上 就要嚴格遵守鏡像的格式要求:
[root@localhost ~]# docker tag nginx:latest docker.io/feixiangkeji974907/nginx:myfirst
這里的feixiangkeji974907 要和 用戶名一樣

推送鏡像
[root@localhost ~]# docker push docker.io/feixiangkeji974907/hello-world:test


刪除標簽
[root@localhost ~]# docker rmi docker.io/fxkj/alpine:latest
刪除鏡像(加INAME ID )
[root@localhost ~]# docker rmi fce289e99eb9
Error response from daemon: conflict: unable to delete fce289e99eb9 (must be forced) – image is being used by stopped container 3c431d073dc1
[root@localhost ~]# docker rmi -f fce289e99eb9 #-f 強制刪除
查看鏡像制作歷史、查看鏡像底層信息
[root@localhost ~]#docker history centos7:laster
[root@localhost ~]# docker inspect nginx:laster
docker 鏡像操作常用命令
(1)、搜索鏡像(在dockerhub倉庫中查找centos的鏡像)
[root@localhost docker]#docker search centos
找出一堆centos鏡像

鏡像的結構: registry_name/repository_name/image_name:tag_name
列如: docjer.io/library/alpine:3.10.1
(2)、鏡像 下載、查看、打標簽、推送
[root@localhost docker]#docker pull nginx (不指定版本下載的話,默認下載最新的latest)

也可以指定版本下載:
[root@localhost ~]# docker pull nginx:1.16 下載Nginx1.16 版本

還可以寫全下載
[root@localhost ~]# docker pull docker.io/library/nginx:1.16
查看本地鏡像
[root@localhost ~]# docker images 或者 [root@localhost ~]# docker image ls

鏡像打標簽
[root@localhost ~]# docker tag nginx:1.16 nginx:local
可以看到多了一個鏡像名,且標簽名為local

如果要把打標簽的鏡像上傳到dockerhub上 就要嚴格遵守鏡像的格式要求:
[root@localhost ~]# docker tag nginx:latest docker.io/feixiangkeji974907/nginx:myfirst
這里的feixiangkeji974907 要和 用戶名一樣

推送鏡像
[root@localhost ~]# docker push docker.io/feixiangkeji974907/hello-world:test


刪除標簽
[root@localhost ~]# docker rmi docker.io/fxkj/alpine:latest
刪除鏡像(加INAME ID )
[root@localhost ~]# docker rmi fce289e99eb9
Error response from daemon: conflict: unable to delete fce289e99eb9 (must be forced) – image is being used by stopped container 3c431d073dc1
[root@localhost ~]# docker rmi -f fce289e99eb9 #-f 強制刪除
查看鏡像制作歷史、查看鏡像底層信息
[root@localhost ~]#docker history centos7:laster
[root@localhost ~]# docker inspect nginx:laster