main: use skopeo for determining image

This commit is contained in:
Dawid Dziurla 2022-10-27 09:58:09 +02:00 committed by GitHub
parent ccc13d96dd
commit 685396f0fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

11
main.js
View file

@ -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
} }
} }
} }