mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 17:03:28 +00:00
chore: add boxlite
This commit is contained in:
parent
a3fe0cc764
commit
c3a95c3611
20 changed files with 824 additions and 1 deletions
16
examples/boxlite/src/setup-image.ts
Normal file
16
examples/boxlite/src/setup-image.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { execSync } from "node:child_process";
|
||||
import { existsSync, mkdirSync } from "node:fs";
|
||||
|
||||
export const DOCKER_IMAGE = "sandbox-agent-boxlite";
|
||||
export const OCI_DIR = new URL("../oci-image", import.meta.url).pathname;
|
||||
|
||||
export function setupImage() {
|
||||
console.log(`Building image "${DOCKER_IMAGE}" (cached after first run)...`);
|
||||
execSync(`docker build -t ${DOCKER_IMAGE} ${new URL("..", import.meta.url).pathname}`, { stdio: "inherit" });
|
||||
|
||||
if (!existsSync(`${OCI_DIR}/oci-layout`)) {
|
||||
console.log("Exporting to OCI layout...");
|
||||
mkdirSync(OCI_DIR, { recursive: true });
|
||||
execSync(`docker save ${DOCKER_IMAGE} | tar -xf - -C ${OCI_DIR}`, { stdio: "inherit" });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue