mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 12:03:53 +00:00
chore: add boxlite
This commit is contained in:
parent
a3fe0cc764
commit
c3a95c3611
20 changed files with 824 additions and 1 deletions
29
examples/boxlite-python/setup_image.py
Normal file
29
examples/boxlite-python/setup_image.py
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
"""Build the sandbox-agent Docker image and export it to OCI layout."""
|
||||
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
DOCKER_IMAGE = "sandbox-agent-boxlite"
|
||||
OCI_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "oci-image")
|
||||
|
||||
|
||||
def setup_image() -> None:
|
||||
dockerfile_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
print(f'Building image "{DOCKER_IMAGE}" (cached after first run)...')
|
||||
subprocess.run(
|
||||
["docker", "build", "-t", DOCKER_IMAGE, dockerfile_dir],
|
||||
check=True,
|
||||
)
|
||||
|
||||
if not os.path.exists(os.path.join(OCI_DIR, "oci-layout")):
|
||||
print("Exporting to OCI layout...")
|
||||
os.makedirs(OCI_DIR, exist_ok=True)
|
||||
subprocess.run(
|
||||
[
|
||||
"skopeo", "copy",
|
||||
f"docker-daemon:{DOCKER_IMAGE}:latest",
|
||||
f"oci:{OCI_DIR}:latest",
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue