Extract "packages" key from skopeo output with jq - Stack Overflow

I'm trying to extract the list of packages from skopeo inspect output, but this does not seem to w

I'm trying to extract the list of packages from skopeo inspect output, but this does not seem to work:

❯ skopeo inspect docker://ghcr.io/ublue-os/bluefin-dx:gts | jq '.Labels."dev.hhd.rechunk.info".packages'

The above works without the ".packages" part and the content is:

❯ skopeo inspect docker://ghcr.io/ublue-os/bluefin-dx:gts | jq '.Labels."dev.hhd.rechunk.info"'
"{\"version\": 2, \"uniq\": \"gts-40.20250305\", \"packages\": {\"libgcc\": \"14.2.1-3.fc40\", .....

How can I ask jq to go into this object and extract just the "packages" part?

I'm trying to extract the list of packages from skopeo inspect output, but this does not seem to work:

❯ skopeo inspect docker://ghcr.io/ublue-os/bluefin-dx:gts | jq '.Labels."dev.hhd.rechunk.info".packages'

The above works without the ".packages" part and the content is:

❯ skopeo inspect docker://ghcr.io/ublue-os/bluefin-dx:gts | jq '.Labels."dev.hhd.rechunk.info"'
"{\"version\": 2, \"uniq\": \"gts-40.20250305\", \"packages\": {\"libgcc\": \"14.2.1-3.fc40\", .....

How can I ask jq to go into this object and extract just the "packages" part?

Share Improve this question asked Mar 8 at 10:19 AlexandrosAlexandros 2,2491 gold badge21 silver badges32 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Use fromjson to parse json text:

$ skopeo inspect docker://ghcr.io/ublue-os/bluefin-dx:gts | jq '.Labels."dev.hhd.rechunk.info" | fromjson.packages'
{
  "libgcc": "14.2.1-3.fc40"
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744898546a4599840.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信