日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

容器学习 之 镜像命令(九)

發布時間:2024/2/28 编程问答 25 豆豆
生活随笔 收集整理的這篇文章主要介紹了 容器学习 之 镜像命令(九) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
  • images 顯示鏡像列表
root@ubuntu:/home/yj# docker images REPOSITORY TAG IMAGE ID CREATED SIZE my-image latest 156761cbda42 4 days ago 200MB httpd latest 0240c8f5816c 9 days ago 132MB centos latest 75835a67d134 2 weeks ago 200MB root@ubuntu:/home/yj# docker images my-image REPOSITORY TAG IMAGE ID CREATED SIZE my-image latest 156761cbda42 4 days ago 200MB root@ubuntu:/home/yj#
  • history 顯示鏡像構建歷史
root@ubuntu:/home/yj# docker history my-image IMAGE CREATED CREATED BY SIZE COMMENT 156761cbda42 4 days ago /bin/sh -c #(nop) ENV WELCOME=you are in mu… 0B 58c8dc2c1373 4 days ago /bin/sh -c #(nop) ADD file:1dd32835d0dddd036… 0B 8e2dc00832b6 4 days ago /bin/sh -c #(nop) COPY file:c47f7dda7d4863fc… 0B f01a0290b924 4 days ago /bin/sh -c touch tmpfile1 0B 01472d2d5f9f 4 days ago /bin/sh -c #(nop) WORKDIR /testdir 0B e66224d7b144 4 days ago /bin/sh -c #(nop) MAINTAINER yangjin@qq.com 0B 75835a67d134 2 weeks ago /bin/sh -c #(nop) CMD ["/bin/bash"] 0B <missing> 2 weeks ago /bin/sh -c #(nop) LABEL org.label-schema.sc… 0B <missing> 2 weeks ago /bin/sh -c #(nop) ADD file:fbe9badfd2790f074… 200MB
  • commit 從容器創建新鏡像
root@ubuntu:/home/yj# docker commit 0c077430c575 my-image2:latest sha256:3ec340b57cca0fbaeff12f082ad33153d5529ae432cb53a2336dba3311b1731b root@ubuntu:/home/yj# docker images REPOSITORY TAG IMAGE ID CREATED SIZE my-image2 latest 3ec340b57cca 18 seconds ago 132MB
  • build 從Dockerfile 構建鏡像

容器學習 之 擴展鏡像(五) 這里有提到怎么用Dockerfile構建鏡像,這也是比較推薦的方式。

  • tag 給鏡像打 tag
root@ubuntu:/home/yj# docker tag my-image2 my-image2:Jim root@ubuntu:/home/yj# docker images my-image2 REPOSITORY TAG IMAGE ID CREATED SIZE my-image2 Jim 3ec340b57cca 5 minutes ago 132MB my-image2 latest 3ec340b57cca 5 minutes ago 132MB
  • rmi 刪除 Docker host 中的鏡像
root@ubuntu:/home/yj# docker images my-image2 REPOSITORY TAG IMAGE ID CREATED SIZE my-image2 Jim 3ec340b57cca 7 minutes ago 132MB my-image2 Ketty 3ec340b57cca 7 minutes ago 132MB my-image2 latest 3ec340b57cca 7 minutes ago 132MB#刪除指定版本號的鏡像 root@ubuntu:/home/yj# docker rmi my-image2:Jim Untagged: my-image2:Jim root@ubuntu:/home/yj# docker images my-image2 REPOSITORY TAG IMAGE ID CREATED SIZE my-image2 Ketty 3ec340b57cca 8 minutes ago 132MB my-image2 latest 3ec340b57cca 8 minutes ago 132MB#默認刪除最新版本的鏡像 root@ubuntu:/home/yj# docker rmi my-image2 Untagged: my-image2:latest root@ubuntu:/home/yj# docker images my-image2 REPOSITORY TAG IMAGE ID CREATED SIZE my-image2 Ketty 3ec340b57cca 8 minutes ago 132MB
  • search 搜索Docker Hub中的鏡像
root@ubuntu:/home/yj# docker search httpd NAME DESCRIPTION STARS OFFICIAL AUTOMATED httpd The Apache HTTP Server Project 2098 [OK] hypriot/rpi-busybox-httpd Raspberry Pi compatible Docker Image with a … 44 centos/httpd 21 [OK] centos/httpd-24-centos7 Platform for running Apache httpd 2.4 or bui… 18 armhf/httpd The Apache HTTP Server Project 8
  • pull 從registry下載鏡像
  • push 將鏡像上傳到registry

下章我們將介紹如何建立本地倉庫和上傳到公有倉庫。

總結

以上是生活随笔為你收集整理的容器学习 之 镜像命令(九)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。