Reproducing a custom container for a flow for debugging

Hello - I’m trying to run a docker container with a custom dockerfile but it is crashing, and I am getting no clues from the agent logs as to what is happening. The container hits the ‘running’ state then crashes with no output, leading me to believe the flow is not even starting. It’s probably something catastrophically silly but I need to reproduce it in an environment where I can get more info.

What I would like to do is build the exact container Prefect was trying to run so I can ssh into it and figure out what I did wrong. I’m having trouble finding help for that in the docs.


  • locally hosted server and agent
  • locally hosted docker registry
  • custom dockerfile (based on official python image with only python deps installed, including Prefect)
  • The docker container infra block has “stream_output” enabled but I don’t see anything, leading me to believe it is not even able to start the flow.
  • GCS storage block for the pipeline code

Hi @timothyrenner

I have encountered something that sounded like this in the past (may or may not be applicable) where I was accidentally pulling the prefect-dev image.

Either way, a couple questions to try and narrow down the cause of error here:

  • can you share the contents of your dockerfile?
  • how did you set the image field on your DockerContainer?
  • did you alter the command field on your DockerContainer infra block? If so, what did you set that to?

Sure - dockerfile is really simple, like this:

FROM python:3.9-slim-buster

COPY deps/requirements.txt .

RUN pip install -r requirements.txt

The image field in the dockerContainer block is localhost:5000/image_name:latest (I’m self-hosting the registry). No changes to the command it’s executing - I left it blank. I also tried inheriting from the prefect image but that did not help.