Skip to content

Commit b0c40ad

Browse files
authored
Fix docker settings docs for custom parent images (#4332)
1 parent 6bdc625 commit b0c40ad

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

docs/book/how-to/containerization/containerization.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,11 @@ The available package installers are:
420420

421421
Full documentation for how `uv` works with PyTorch can be found on the Astral Docs website [here](https://docs.astral.sh/uv/guides/integration/pytorch/). It covers some of the particular gotchas and details you might need to know.
422422

423+
{% hint style="info" %}
424+
If you're using `uv` and specify a custom parent image or Dockerfile that does not have an activated virtual environment, you need to pass `python_package_installer_args={"system": None}` in your DockerSettings so that
425+
`uv` installs the packages for the Python system installation. Depending on the parent image, you might also need to include `"break-system-packages": None` in the installer args as well to make it work.
426+
{% endhint %}
427+
423428
## Private PyPI Repositories
424429

425430
For packages that require authentication from private repositories:

docs/book/user-guide/tutorial/distributed-training.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ from zenml.config import DockerSettings
4747

4848
docker = DockerSettings(
4949
parent_image="pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime",
50+
python_package_installer_args={"system": None},
5051
requirements=["zenml", "torchvision"]
5152
)
5253

@@ -111,6 +112,7 @@ Use the same CUDA image as above **plus** add Accelerate to the requirements:
111112
```python
112113
DockerSettings(
113114
parent_image="pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime",
115+
python_package_installer_args={"system": None},
114116
requirements=["zenml", "accelerate", "torchvision"]
115117
)
116118
```

0 commit comments

Comments
 (0)