https://prefect.io logo
Title
k

Kalise Richmond

12/13/2022, 5:39 PM
@ask-marvin how do I use Docker with Prefect?
a

ask-marvin

12/13/2022, 5:39 PM
Let me check that for you @Kalise Richmond
You can use Docker as a virtual machine to run Prefect's
k

Kalise Richmond

12/13/2022, 5:39 PM
@ask-marvin how do I run a flow with Docker?
a

ask-marvin

12/13/2022, 5:39 PM
Let me check that for you @Kalise Richmond
You can use the
run_in_docker
function to do that. Here is an example:```from prefect import flow, taskfrom prefect.utilities.docker import run_in_docker@flow(name="my-flow", state=["A", "B"], subflows=[run_in_docker(name="C"), run_in_docker(name="D")])def my_flow(): A, B = run_in_docker( name="C") D = run_in_docker( name="D") print(A) print(B)my_flow()```