Skip to content

Commit d57bddf

Browse files
desertaxleclaude
andauthored
Fix incorrect Dockerfile example in "Deploy via Python" guide (#19653)
Co-authored-by: Claude <[email protected]>
1 parent 2f638cd commit d57bddf

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/v3/how-to-guides/deployments/deploy-via-python.mdx

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,29 @@ In this example, we set `push=False` to skip pushing the image to a registry. Th
110110
In the above example, we didn't specify a Dockerfile. By default, Prefect will generate a Dockerfile for us that copies the flow code into an image and installs
111111
any additional dependencies.
112112

113-
If you want to write and use your own Dockerfile, you can do so by passing a `dockerfile` parameter to `flow.deploy`.
113+
If you want to write and use your own Dockerfile, you can do so by using `DockerImage`:
114+
115+
```python
116+
from prefect import flow
117+
from prefect.docker import DockerImage
118+
119+
120+
@flow(log_prints=True)
121+
def my_flow(name: str = "world"):
122+
print(f"Hello, {name}!")
123+
124+
125+
if __name__ == "__main__":
126+
my_flow.deploy(
127+
name="my-deployment",
128+
work_pool_name="my-work-pool",
129+
image=DockerImage(
130+
name="my-registry.com/my-docker-image:my-tag",
131+
dockerfile="Dockerfile",
132+
),
133+
push=False,
134+
)
135+
```
114136
</Note>
115137

116138
### Trigger a run

0 commit comments

Comments
 (0)