假设我有这个 json
{
"sha256:0085b5379bf1baeb4a430128782440fe636938aa739f6a5ecc4152a22f19b08b": {
"imageSizeBytes": "596515805",
"layerId": "",
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"tag": [
"python-3-toolchain-0.1.2"
],
"timeCreatedMs": "1564631021992",
"timeUploadedMs": "1564631067325"
},
"sha256:1ec7631f74a3d6d37bf9194c13854f33315260ae1f27347263dd0a8974ee82bb": {
"imageSizeBytes": "513574770",
"layerId": "",
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"tag": [
"python-2-toolchain-latest"
],
"timeCreatedMs": "1535447023647",
"timeUploadedMs": "1535447042373"
}
}
我想选择带有特定标签的图像信息(以及 sha256 摘要)。示例:我只想选择tag == "python-2-toolchain-latest",所以它打印这个 json (使用 json 重新格式化)
{
"digest": "sha256:1ec7631f74a3d6d37bf9194c13854f33315260ae1f27347263dd0a8974ee82bb",
"imageSizeBytes": "513574770",
"layerId": "",
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"tag": [
"python-2-toolchain-latest"
],
"timeCreatedMs": "1535447023647",
"timeUploadedMs": "1535447042373"
}
我尝试了各种方法,并被困在如何引用 sha256 关键信息上。