main: use skopeo for determining image
This commit is contained in:
parent
ccc13d96dd
commit
685396f0fc
11
main.js
11
main.js
|
@ -19,9 +19,16 @@ function getImageTag(imageName, distribution) {
|
||||||
async function getImageName(distribution) {
|
async function getImageName(distribution) {
|
||||||
const tag = getImageTag("", distribution)
|
const tag = getImageTag("", distribution)
|
||||||
for (const image of ["debian", "ubuntu"]) {
|
for (const image of ["debian", "ubuntu"]) {
|
||||||
const tags = await hub.queryTags({ user: "library", name: image })
|
try {
|
||||||
if (tags.find(t => t.name == tag)) {
|
await exec.exec("skopeo", [
|
||||||
|
"inspect",
|
||||||
|
"--no-tags",
|
||||||
|
"--no-creds",
|
||||||
|
`docker://docker.io/library/${image}:${tag}`
|
||||||
|
])
|
||||||
return image
|
return image
|
||||||
|
} catch {
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue