A guide to configuring a base image for your truss
config.yaml
configure a base_image
.
python_executable_path
is a path to a python executable with which to run your server.
DOCKER_REGISTRY_<REGISTRY_URL>
will be supplied to your model build to authenticate image pulls from private container registries.
For information on where to store secret values see the secrets guide.
For example, to configure docker credentials to a private dockerhub repository your config.yaml
should include the following secret and placeholder:
DOCKER_REGISTRY_https://index.docker.io/v1/
with a base64 encoded username:password
secret value:
us-west2
your config.yaml
should include the following secret and placeholder:
3.11-gpu-v0.7.16
is for Python 3.11 and has GPU support.
On the other hand, image 3.9-v0.7.15
is for Python 3.9 and does not have GPU support. Based on your project requirements you can select the appropriate base image.
Next, we can write our Dockerfile
.
truss-server-base
as our base image. This base image comes with some python dependencies installed.
If you want to override the versions of these default python dependencies you can simply uninstall the package and reinstall it using the RUN pip install
command.
You can even add you own files or directories to this Dockerfile if required. Once you have your Dockerfile set up, you can build, tag, and push the image to your own docker registry.
my-custom-base-image
with the name for your docker image.
Next, to tag the image you can run the command: