校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > docker volume刪除卷的操作

docker volume刪除卷的操作

熱門標簽:400電話辦理介紹信 上海申請高400開頭的電話 打400電話怎么辦理收費 怎么找到?jīng)]有地圖標注的店 10086外包用的什么外呼系統(tǒng) 河南防封號電銷機器人是什么 宿城區(qū)電話機器人找哪家 麗江真人語音電話外呼系統(tǒng) 福州企業(yè)電銷機器人排名

prune

要使用此命令,客戶端和守護程序API版本都必須至少為1.25。在客戶端上使用docker version命令可以檢查客戶端和守護程序API版本。

docker volume prune [OPTIONS]

刪除未被任何容器使用的本地卷。

OPTIONS

名稱,簡寫 說明
--filter 提供過濾值。
--force , -f 不提示確認信息,直接刪除。

rm

要使用此命令,客戶端和守護程序API版本都必須至少為1.21。在客戶端上使用docker version命令可以檢查客戶端和守護程序API版本。

docker volume rm [OPTIONS] VOLUME [VOLUME...]

刪除一個或多個卷。從1.25版本起,支持一個選項--force , -f,強制刪除一個或多個卷。

補充:docker 移除,裁剪,刪除(prune)不使用的鏡像、容器、卷、網(wǎng)絡

參考docker prune

提供 prune命令,用于移除不使用的鏡像、容器、卷、網(wǎng)絡。

Prune images

docker image prune移除沒有標簽并且沒有被容器引用的鏡像,這種鏡像稱為 dangling(搖晃的) 鏡像。

示例1:docker image prune

刪除了redis,無標簽且無引用

#docker ps -a
CONTAINER ID IMAGE  COMMAND CREATED STATUS PORTS  NAMES
# docker images
REPOSITORY    TAG  IMAGE ID  CREATED  SIZE
nginx     latest ae2feff98a0c 4 days ago  133MB
redis     <none> ef47f3b6dc11 8 days ago  104MB
centos     latest 300e315adb2f 12 days ago 209MB
ubuntu     latest f643c72bc252 3 weeks ago 72.9MB
docs/docker.github.io latest 32ed84d97e30 6 months ago 1GB
# docker image prune
# docker images
REPOSITORY    TAG  IMAGE ID  CREATED  SIZE
nginx     latest ae2feff98a0c 4 days ago  133MB
centos     latest 300e315adb2f 12 days ago 209MB
ubuntu     latest f643c72bc252 3 weeks ago 72.9MB
docs/docker.github.io latest 32ed84d97e30 6 months ago 1GB

示例2:移除所有沒有容器使用的鏡像 -a

docker image prune -a

跳過警告提示:--force或-f

docker image prune -f

示例3:執(zhí)行過濾刪除:

超過24小時創(chuàng)建的鏡像

docker image prune -a --filter "until=24h"

關(guān)于過濾器的內(nèi)容,查看 docker image prune手冊

移除容器s

當停止容器,不會自動刪除,除非在 docker run 時指定了 --rm。一個停止的容器可寫層仍然會占用磁盤空間,所以清除它,使用 docker container prune命令。

其他參數(shù)類似 docker images prune

移除卷

卷會被一個或多個容器使用,并且占用主機空間。卷不會自動移除,因為自動移除,會破壞數(shù)據(jù)。

docker volume prune

其他參數(shù)類似 docker images prune

移除網(wǎng)絡

Docker 網(wǎng)絡不會占用磁盤空間,但是他們創(chuàng)建了 iptables規(guī)則,橋接網(wǎng)絡服務,路由entries。清除未被容器使用的網(wǎng)絡,這么做

docker network prune

其他參數(shù)類似 docker images prune

移除 Everything

docker system prune 命令是一個快捷方式,用于移除鏡像,容器,網(wǎng)絡。

在 Docker 17.06.0 和更早,卷也是可以移除的。在Docker 17.06.1或更高版本,需要指定參數(shù)--volumes。

示例(沒有移除卷):

# docker system prune
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all dangling images
  - all build cache
Are you sure you want to continue? [y/N] y

示例(有了移除卷功能):添加--volumes

# docker system prune --volumes
WARNING! This will remove:
  - all stopped containers
  - all networks not used by at least one container
  - all volumes not used by at least one container
  - all dangling images
  - all build cache
Are you sure you want to continue? [y/N] y

其他參數(shù)類似 docker images prune

以上為個人經(jīng)驗,希望能給大家一個參考,也希望大家多多支持腳本之家。如有錯誤或未考慮完全的地方,望不吝賜教。

標簽:連云港 運城 遵義 隴南 荊門 面試通知 雞西 朝陽

巨人網(wǎng)絡通訊聲明:本文標題《docker volume刪除卷的操作》,本文關(guān)鍵詞  docker,volume,刪除,卷,的,操作,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《docker volume刪除卷的操作》相關(guān)的同類信息!
  • 本頁收集關(guān)于docker volume刪除卷的操作的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 台湾省| 贺州市| 肃北| 科技| 三明市| 剑阁县| 扶沟县| 敖汉旗| 郧西县| 获嘉县| 全椒县| 新津县| 汾阳市| 延吉市| 英超| 中卫市| 大荔县| 新沂市| 兴国县| 阿拉善右旗| 珠海市| 张家口市| 扎赉特旗| 龙陵县| 贡觉县| 若羌县| 澄迈县| 民丰县| 廊坊市| 郯城县| 湘西| 涪陵区| 大英县| 临泽县| 扶风县| 蓬安县| 高平市| 温泉县| 五峰| 闵行区| 东乡族自治县|