2024-11-28 18:11:07 +08:00
|
|
|
#!/usr/bin/env bun
|
|
|
|
const $ = Bun.$;
|
|
|
|
|
|
|
|
const sharedDir = import.meta.dir;
|
|
|
|
const tag = process.argv[2];
|
|
|
|
const dirName = process.argv[3];
|
|
|
|
const arches = process.argv[4].split(",");
|
|
|
|
const pathToDnfCache = process.env["DNF_CACHE_PATH"];
|
|
|
|
|
|
|
|
await $`buildah manifest create ${tag}`;
|
|
|
|
for (const arch of arches) {
|
|
|
|
await $`buildah build --arch ${arch} \
|
|
|
|
--pid=host --ipc=host --network=host --userns=host \
|
2024-11-28 20:06:15 +08:00
|
|
|
--uts=host ${pathToDnfCache ? `-v${pathToDnfCache}:/var/cache/dnf:O` : ""} \
|
2024-11-28 18:11:07 +08:00
|
|
|
--manifest code.lightstands.xyz/standcoded/${tag} \
|
|
|
|
--volume ${sharedDir}:/imgbuild:z ${dirName}`;
|
|
|
|
}
|