I’m trying to run a docker container from a prefec...
# ask-community
s
I’m trying to run a docker container from a prefect flow. The prefect 1.0 solution of using DockerRun seemed to be ideal, so I’m looking for a replacement … however DockerContainer has issues connecting to my local docker server … Here’s my (derived from @Nate’s example - thanks!) code …
Copy code
from prefect.infrastructure.container import DockerContainer
DockerContainer(
    image="my_image",
    command=["python", "/app/modules/my_image/scripts/run_test_script.py"]
).run()
But this gives the following error: 404 Client Error for http+docker://localhost/v1.41/images/create?tag=latest&fromImage=my_image: However it runs fine from the command line if I use:
docker run --entrypoint python my_image /app/modules/my_image/scripts/run_test_script.py
Do I need to somehow set permissions for prefect to access docker? How do I do that for a local docker container?