_settings})

def my_pipeline() -> None:

my_step()# Or configure the pipelines options

my_pipeline = my_pipeline.with_options(

settings={"docker": docker_settings}

Configuring them on a step gives you more fine-grained control and enables you to build separate specialized Docker images for different steps of your pipelines:

docker_settings = DockerSettings()

# Either add it to the decorator

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

def my_step() -> None:

pass

# Or configure the step options

my_step = my_step.with_options(

settings={"docker": docker_settings}

Using a YAML configuration file as described here:

settings:

docker:

...

steps:

step_name:

settings:

docker:

...

Check out this page for more information on the hierarchy and precedence of the various ways in which you can supply the settings.

Specifying Docker build options

If you want to specify build options that get passed to the build method of the image builder. For the default local image builder, these options get passed to the docker build command.

docker_settings = DockerSettings(build_config={"build_options": {...}})

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

def my_pipeline(...):

...

If you're running your pipelines on MacOS with ARM architecture, the local Docker caching does not work unless you specify the target platform of the image:

docker_settings = DockerSettings(build_config={"build_options": {"platform": "linux/amd64"}})

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

def my_pipeline(...):

...

Using a custom parent image

By default, ZenML performs all the steps described above on top of the official ZenML image for the Python and ZenML version in the active Python environment. To have more control over the entire environment used to execute your pipelines, you can either specify a custom pre-built parent image or a Dockerfile that ZenML uses to build a parent image for you.