簡體   English   中英

containerd 中 docker 卷的等價物是多少?

[英]What is the equivalent of docker volumes in containerd?

在 Docker 中,我們可以通過卷配置持久存儲。 在 Docker cli 中,我們使用“docker volume”:

$ docker volume --help

Usage:  docker volume COMMAND

Manage volumes

Commands:
  create      Create a volume
  inspect     Display detailed information on one or more volumes
  ls          List volumes
  prune       Remove all unused local volumes
  rm          Remove one or more volumes

Run 'docker volume COMMAND --help' for more information on a command.

看起來 containerd cli (ctr) 沒有等效項。 他們確實有內容:

$ ctr content --help
NAME:
   ctr content - manage content

USAGE:
   ctr content command [command options] [arguments...]

COMMANDS:
   active                   display active transfers
   delete, del, remove, rm  permanently delete one or more blobs
   edit                     edit a blob and return a new digest
   fetch                    fetch all content for an image into containerd
   fetch-object             retrieve objects from a remote
   get                      get the data for an object
   ingest                   accept content into the store
   list, ls                 list all blobs in the store
   push-object              push an object to a remote
   label                    add labels to content

OPTIONS:
   --help, -h  show help

還有截圖:

$ ctr snapshot --help
NAME:
   ctr snapshots - manage snapshots

USAGE:
   ctr snapshots command [command options] [arguments...]

COMMANDS:
   commit            commit an active snapshot into the provided name
   diff              get the diff of two snapshots. the default second snapshot is the first snapshot's parent.
   info              get info about a snapshot
   list, ls          list snapshots
   mounts, m, mount  mount gets mount commands for the snapshots
   prepare           prepare a snapshot from a committed snapshot
   remove, rm        remove snapshots
   label             add labels to content
   tree              display tree view of snapshot branches
   unpack            unpack applies layers from a manifest to a snapshot
   usage             usage snapshots
   view              create a read-only snapshot from a committed snapshot

OPTIONS:
   --snapshotter value  snapshotter name. Empty value stands for the default value. [$CONTAINERD_SNAPSHOTTER]
   --help, -h           show help

哪個是等價的? 我應該如何解釋 ctr cli 輸出的結果?

來自: https://containerd.io/scope/

containerd 被設計為嵌入到更大的系統中,因此它只包含一個專門用於開發和調試目的的准系統 CLI (ctr),沒有要求人性化,也不能保證界面隨時間的穩定性。

看看runchttps://danishpraka.sh/2020/07/24/introduction-to-runc.html

運行時規范

在使用 docker 運行容器時指定配置選項(例如卷掛載、memory 限制或 uid:gid 映射)就像為 Z05B6053C41A2130AFD6FC3B158BDA4E6 命令指定命令行選項一樣簡單。 在使用 runc 時,這些配置將作為文件傳遞給 runc。 此配置文件,即運行時規范,是由開放容器倡議 (OCI) 制定的配置標准,用於指定容器的選項,並由 runc[2] 使用。 簡而言之,運行時規范是一個名為 config.json 的 JSON 文件,其中包含與特定容器相關的配置。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM