Skip to main content
Bake a Docker image with the specified dependencies. This is a composable building block that can be used standalone or combined with AppDeployer to deploy apps with custom images. Parameters:
object
Dictionary of PyPI packages to install. Keys are package names, values are version specifiers. For example, {"flask": ">=2.0", "requests": ""}. Mutually exclusive with requirements_file and pyproject_toml.
object
Dictionary of conda packages to install.
string
Path to a requirements.txt file. Mutually exclusive with pypi and pyproject_toml.
string
Path to a pyproject.toml file. Mutually exclusive with pypi and requirements_file.
string
Base Docker image to build from. Defaults to the platform default image.
string
Python version to use, such as 3.11.0. If not set, uses the Python already present in base_image and installs dependencies into it. If set, a new Python environment at that version is created inside the base image, and all dependencies are installed into it.
function
Logger function for progress messages.
Returns:
BakedImage
A named tuple containing image (the baked Docker image URL) and python_path (the path to the Python executable in the image).
Raises:
  • ImageBakingException: If baking fails or if invalid parameters are provided.
Examples: Bake with PyPI packages:
Bake from requirements.txt:
Bake from pyproject.toml:
Combine with AppDeployer: