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.

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: To build a Docker image for your Truss, use the following:
truss image build
To build with a custom tag, use the following:
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: To create a build context in a specific directory, use the following:
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.
--attach
Attach to the container process.

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: To build and run a Truss locally, use the following:
truss image run
To run on a specific port, use the following:
truss image run --port 8080
To run in attached mode, use the following:
truss image run --attach