Hello! I am running into an issue with Docker Stor...
# prefect-server
w
Hello! I am running into an issue with Docker Storage and a flow that is stored as a script. I am using the dockerfile parameter to build a custom image where the flow is stored is. The issue is that the healthchecks fail because it's looking for the dockerfile that was used in the flow. I didn't copy it over into the docker image because it wasn't relevant to the flow itself. Has this been something that you any of you have ran into? I can disable the healthchecks but that doesn't seem like the best path.
a
@William Clark the problem with using Docker storage and flow
stored_as_script
is that in this configuration you don’t want to build the image during registration, since it has already been built by you and the flow has already been copied into your Docker image. But by default, the storage is always built upon registration. To fix it, you need to explicitly add the flow object to your storage object, and then use
build=False
to prevent from building the image on registration:
Copy code
if __name__ == "__main__":
    docker_storage.add_flow(flow)
    flow.register(project_name="community", build=False)
The full flow example is available here: https://github.com/anna-geller/packaging-prefect-flows/blob/master/flows_no_build/docker_script_docker_run_local_image.py
w
I see, thank you so much Anna! I really appreciate your prompt response!
🙌 1