vers build
Build custom rootfs images from Dockerfiles for your Vers environment.Synopsis
Description
Thebuild command creates custom rootfs (root filesystem) images by packaging your project directory and building it with Docker. This lets you create specialized environments with pre-installed dependencies and configurations.
Requirements
vers.toml Configuration File
You need avers.toml file in your current directory. If it doesn’t exist, the command will use default values but show a warning.
Complete vers.toml structure:
Docker Builder Required
The builder must be set to"docker". Other values are not supported:
name = "none", the build will be skipped:
Dockerfile Required
You must have a Dockerfile at the specified path (default:./Dockerfile):
Restrictions
Cannot Use “default” Name
You cannot build a rootfs named “default”:Build Process
- Configuration Loading: Loads
vers.tomlor uses defaults - Validation: Checks builder type and Dockerfile existence
- Archive Creation: Creates tar archive of current directory (excludes
.vers/andvers.toml) - Upload: Uploads archive to Vers platform with 10-minute timeout
- Docker Build: Platform builds your Dockerfile
- Registration: Rootfs becomes available for VM creation
Command-Line Flags
Flags override values fromvers.toml:
--rootfs <name>
Override the rootfs name:
--dockerfile <path>
Override the Dockerfile path:
Examples
Basic Build with vers.toml
Override Rootfs Name
Development vs Production Builds
Node.js Application
File Exclusions
The build automatically excludes these files from the tar archive:.vers/directory (Vers internal data)vers.tomlfile (configuration file)- The temporary tar file itself
Build Timeout
Builds have a 10-minute timeout. If your build takes longer, it will fail with a timeout error.Using Built Images
After building, use your custom rootfs by updatingvers.toml:
Error Scenarios
Missing Dockerfile
--dockerfile to specify the correct path.
Unsupported Builder
builder.name = "docker" in vers.toml.
Protected Name
rootfs.name to something other than “default”.
Configuration File Issues
See Also
- vers rootfs - Manage existing rootfs images
- vers up - Start VMs using your built images
- vers init - Create a new vers.toml configuration file