er": docker_settings})

def my_pipeline(...):

...Specify a list of apt packages in code:Copydocker_settings = DockerSettings(apt_packages=["git"])

@pipeline(settings={"docker": docker_settings})
def my_pipeline(...):
    ...

Prevent ZenML from automatically installing the requirements of your stack:Copydocker_settings = DockerSettings(install_stack_requirements=False)

@pipeline(settings={"docker": docker_settings})
  def my_pipeline(...):
      ...

In some cases the steps of your pipeline will have conflicting requirements or some steps of your pipeline will require large dependencies that don't need to be installed to run the remaining steps of your pipeline. For this case, ZenML allows you to specify custom Docker settings for steps in your pipeline.

docker_settings = DockerSettings(requirements=["tensorflow"])

@step(settings={"docker": docker_settings})

def my_training_step(...):

...

You can combine these methods but do make sure that your list of requirements does not overlap with the ones specified explicitly in the Docker settings.

Depending on the options specified in your Docker settings, ZenML installs the requirements in the following order (each step optional):

The packages installed in your local Python environment

The packages specified via the requirements attribute (step level overwrites pipeline level)

The packages specified via the required_integrations and potentially stack requirements

You can specify additional arguments for the installer used to install your Python packages as follows:

# This will result in a `pip install --timeout=1000 ...` call when installing packages in the

# Docker image

docker_settings = DockerSettings(python_package_installer_args={"timeout": 1000})

@pipeline(settings={"docker": docker_settings})

def my_pipeline(...):

...

Experimental: If you want to use uv for faster resolving and installation of your Python packages, you can use by it as follows:

docker_settings = DockerSettings(python_package_installer="uv")