collect reusable code
This commit is contained in:
parent
efd52d057f
commit
bacbf7d67e
10 changed files with 290 additions and 63 deletions
17
shared/build-image.ts
Normal file
17
shared/build-image.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/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 \
|
||||
--uts=host ${pathToDnfCache ? `-v /var/cache/dnf:/var/cache/dnf` : ""} \
|
||||
--manifest code.lightstands.xyz/standcoded/${tag} \
|
||||
--volume ${sharedDir}:/imgbuild:z ${dirName}`;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue