Skip to main content

extract-oci-archive

Use when you need to extract an OCI archive to inspect its contents, get the rootfs layer, or read the image config.

来源信息

仓库
coreos/chunkah
最近来源活动
2026年4月30日 02:31
检测到的 SKILL.md 语言
英语
星标
148
分支
17

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
extract-oci-archive
description
Use when you need to extract an OCI archive to inspect its contents, get the rootfs layer, or read the image config.
# Extract OCI Archive ## Extract the OCI archive structure ```bash mkdir /tmp/oci-extracted tar -xf /path/to/image.ociarchive -C /tmp/oci-extracted ``` ## Get the manifest digest from index.json ```bash MANIFEST=$(jq -r '.manifests[0].digest' /tmp/oci-extracted/index.json \ | cut -d: -f2) ``` ## Extract a layer to get the rootfs For a single-layer image: ```bash LAYER=$(jq -r '.layers[0].digest' \ /tmp/oci-extracted/blobs/sha256/${MANIFEST} | cut -d: -f2) mkdir /tmp/rootfs tar -xf /tmp/oci-extracted/blobs/sha256/${LAYER} -C /tmp/rootfs ``` For multi-layer images, extract each layer in order and overlay them. ## Read the image config The config contains the created timestamp, entrypoint, labels, etc.: ```bash CONFIG=$(jq -r '.config.digest' \ /tmp/oci-extracted/blobs/sha256/${MANIFEST} | cut -d: -f2) jq . /tmp/oci-extracted/blobs/sha256/${CONFIG} ```
在 GitHub 查看