Prerequisites
- Permission to create resources in your team.
- For the CLI procedures, the Baseten CLI, signed in.
Choose a built-in image
The image catalog lists built-in environments for languages, browsers, web applications, and desktops, plus the custom images built by teams you can access. Each image has an Image reference, such asbaseten/base-image:latest, that you use to
create a sandbox.
- UI
- CLI
To choose a built-in image:
- Sign in to your workspace at app.baseten.co and choose Sandboxes in the sidebar.
- Choose Create sandbox.
- To narrow the catalog, type a runtime or image name in Search images, or select a workload under Category. Clear category filters to include Base Image, which has no category.
- Choose an image card, then review its Image, Default memory, and Ports.
Create a custom image
A custom image packages the dependencies and starting files your tasks need. Build one from a Dockerfile or import one from a registry, using the CLI. To build a custom image:-
Set a new repository name, then create and enter a build directory:
-
Create a Dockerfile. A sandbox image must include the sandbox API server
and start it as the entrypoint, so copy it from the sandbox API image. This
example starts from the same base as Base Image (Alpine Linux with
Node.js, Python, Git, and Bash), adds a package and a starting file:
-
Push the directory and wait for the image to build. Don’t include
credentials in the directory:
-
Create a sandbox from the image, and check that the package and the
starting file are there:
-
Set a new repository name and the source image’s full registry reference,
including the registry hostname. The source image must include and start
the sandbox API server, as the built-in images do:
-
Push the image:
The CLI returns once the import is accepted. Add
--waitto wait until the import finishes:To import from a private registry, pass a Dockerconfig.jsonwith its credentials:
List images
Check a custom image’s build status before using it. The Images tab andbaseten sandbox image list list only your team’s custom images, not built-in
images.
- UI
- CLI
To list your team’s images:
- In Sandboxes, choose Images.
- For Find by image name or tag, type the image name.
- Review the matching row’s Latest size, Sandboxes, Updated, and Status values.
List versions
An image groups its versions under one repository name. Each version has a tag that Baseten assigns; you can’t choose or rename it. List the tags to pin a sandbox to one version.- UI
- CLI
To list an image’s versions:
- In Sandboxes > Images, choose the image.
- Review the tags table on its Overview, with each version’s Tag, Size, Created, and Updated values.
Add a version
Add a version when your image’s dependencies or starting files change. Pushing changed source to an existing repository name adds a version with a new tag, andsandbox/<IMAGE_NAME>:latest resolves to it. Pushing identical source
doesn’t add a version. Existing versions stay available, so sandboxes that use
a specific tag keep their version.
To add a version:
- Run
baseten sandbox image pushagain with the sameIMAGE_NAME, following Create a custom image. - List the image’s versions and confirm a new tag appears.
Use an image in a sandbox
Create a sandbox from the image in the dashboard, or pass its reference to--image:
sandbox/<IMAGE_NAME>:latest.
latest always resolves to the newest version and doesn’t appear in the tag
list, so it can point to a different version after your next build. To keep
new sandboxes on one version, pin a tag from
baseten sandbox image list-tags or the dashboard in your application’s
configuration, such as sandbox/<IMAGE_NAME>:<TAG_NAME>, and create the
sandbox in the team that owns the image.
Delete an image or a version
Deleting a sandbox doesn’t delete its image. Delete an image or a version separately when you no longer need it.Deleting a tag removes that version, and deleting the repository removes all
its versions. Keep any version you plan to create more sandboxes from.
- UI
- CLI
To delete a version:
- In Sandboxes > Images, choose the image.
- In the tags table, open the actions menu on the version’s row.
- Choose Delete tag, then choose Delete tag again to confirm.
- In Sandboxes > Images, open the actions menu on the image’s row.
- Choose Delete image.
- Type the image’s name, then choose Delete image.