Base images
Use a Debian base image for the target architecture:sail.Image.debian_arm is an alias for sail.Image.debian_arm64.
sail.Image.debian_amd is an alias for sail.Image.debian_amd64.
Install Python packages
Usepip_install() for Python dependencies:
exec().
Add local files
Useadd_local_file() to copy a single local file into the image:
add_local_dir() to copy a directory tree:
ignore argument accepts
gitignore-style patterns or a path to an ignore file.
Use image files for source code, static assets, and configuration that should
exist before boot. Use Filesystem for runtime inputs,
outputs, logs, and data that changes per Sailbox.
Install system packages
Useapt_install() for Debian packages:
Run shell commands
Userun_commands() for shell commands that should execute during the image
build:
Set environment variables
Useenv() for environment variables that should be present in Sailboxes
created from the image:
Create a Sailbox from an image
Pass the image definition toSailbox.create():
Sailbox.create() builds the image first if it has not already been built, then
starts the VM from that image.
Build an image ahead of time
Usebuild() when you want to prepare the image before creating a Sailbox: