Skip to main content
truss image [OPTIONS] COMMAND [ARGS]...
Build and manage Docker images for your Truss.

build

Build the Docker image for a Truss.
truss image build [OPTIONS] [TARGET_DIRECTORY] [BUILD_DIR]

Options

--tag
TEXT
Docker image tag.
--use_host_network
Use the host network for the Docker build.

Arguments

TARGET_DIRECTORY
TEXT
A Truss directory. Defaults to current directory.
BUILD_DIR
TEXT
Image context directory. If not provided, a temp directory is created.
Example: Build a Docker image for your Truss:
truss image build
Build with a custom tag:
truss image build --tag my-model:v1

build-context

Create a Docker build context for a Truss without building the image.
truss image build-context [OPTIONS] BUILD_DIR [TARGET_DIRECTORY]

Arguments

BUILD_DIR
TEXT
required
Directory where image context is created.
TARGET_DIRECTORY
TEXT
A Truss directory. Defaults to current directory.
Example: Create a build context in a specific directory:
truss image build-context ./build-context

run

Run the Docker image for a Truss locally.
truss image run [OPTIONS] [TARGET_DIRECTORY] [BUILD_DIR]

Options

--tag
TEXT
Docker image tag to run.
--port
INTEGER
Local port to expose the model on. Default: 8080.
--attach
Attach to the container process.
--use_host_network
Use the host network for the Docker build and run.

Arguments

TARGET_DIRECTORY
TEXT
A Truss directory. Defaults to current directory.
BUILD_DIR
TEXT
Image context directory. If not provided, a temp directory is created.
Example: Build and run a Truss locally:
truss image run
Run on a custom port:
truss image run --port 9000
Run in attached mode:
truss image run --attach