antony@notes:~/container$ cat "探索-OCI-Image-Specification.md"
探索 OCI Image Specification
探索 OCI Image Specification
1. 什麼是 Image Format Specification
- 由 Open Container Initiative 這個組織定義了 Image 的格式規範,一個 OCI Image, 必須包含 :
- 一個 image manifest
- 一個 image index (可選的)
- 一組/多個 filesystem layers
- 一個 configuration
2. 認識 OCI Image

index.json在 OCI Image Spec 中被稱為 Image Index ,這個 Json 格式的文檔內容會描述 Image Manifest 文檔的檔名、檔案大小,不同的 CPU 架構 (ARM 64-bit、x86_64…等) 會指向不同的 Image Manifest 文檔- Image Manifest 是 Container Image 的架構說明檔,裡面描述 Container Image 是由哪些元件組成,譬如在被 sha256 哈希演算法運算後,Image Configuration 和 Filesystem Layer 這兩個檔案的名稱是甚麼、檔案大小…等資訊。
3. 檢視 OCI Image 內部結構
# 1. 透過 skopeo 上網到 docker.io 這個光片中心下載 ubuntu:latest image,並以 OCI 的格式儲存在當前使用者家目錄底下的 ubuntu-oci 目錄區
$ skopeo --insecure-policy copy --src-no-creds docker://docker.io/library/ubuntu:latest oci:/home/$USER/ubuntu-oci:latest
# 2. 檢視 OCI Image 內部結構
$ cd; tree ubuntu-oci/
ubuntu-oci/
├── blobs
│ └── sha256
│ ├── 35a88802559dd2077e584394471ddaa1a2c5bfd16893b829ea57619301eb3908
│ ├── 9c704ecd0c694c4cbdd85e589ac8d1fc3fd8f890b7f3731769a5b169eb495809
│ └── c920ba4cfca05503764b785c16b76d43c83a6df8d1ab107e7e6610000d94315c
├── index.json
└── oci-layout
3 directories, 5 files