container/storage是container/image的基础,和containerd snapshotter接口功能类似,但是是两套接口。
    storage用于管理layer、image、container。
    layer对应的就是overlayfs的一层,image对应的就是一个镜像,container对应的就是基于image+读写layer的容器rootfs。

    https://github.com/containers/podman/issues/4739 支持additional layer store(ALS),需要配置addition layer store或者通过以下脚本

    假设配置为:
    layerstore=:::…:

    查找方式:

    1. <ALS root>/base64("key1=value1")/base64("key2=value2")/.../base64("keyX=valueX")/
    2. `-- diff 是个目录,包含这一层的different
    3. `-- info 是文件,包含 "*c/storage.Layer" struct

    If the layer content is found in ALS, c/storage.Store creates layer using /…/info as *c/storage.Layer and using /…/diff as its diff directory.

    1. podman --storage-opt "layerstore=/tmp/storage:reference:layerdigest" pull ghcr.io/stargz-containers/rethinkdb:2.3.6-esgz
    2. podman --storage-opt "layerstore=/tmp/storage:reference:layerdigest" run --rm -it ghcr.io/stargz-containers/rethinkdb:2.3.6-esgz /bin/echo 'Hello, World!'
    1. stargz-store是mount在“/tmp/storage”
    2. storage.store会通过ALS(additional layer store)查找 /tmp/storage/base64(“reference=ghcr.io/stargz-containers/rethinkdb:2.3.6-esgz”)/base64()/{diff, info}
    3. 然后 stargz-store会去拉取需要的信息。

    stargz-store 作为单独进程启动,在读取文件stargz会通过stargz lazy拉取:
    stargz-store

    1. <mountpoint>/base64(imageref)/<layerdigest>/
    2. - diff : exposes the extracted layer
    3. - info : contains JSON-formatted "Layer" structure of containers/storage
    4. - use : files to notify the use of this layer (used for management of reference count)