Set image on DOCKERRUN to my private registry

Hello everyone,

I want to retrieve my custom image that has some private python packages from my private registry.

I use NEXUS.

RUNCONFIG =DockerRun(image=“testprefect:latest”)

Is it possible to retrieve my image from Nexus or only from azure and aws registries ?

Thanks in regards

1 Like

Welcome to Discourse, @Rafael_Sa! :wave: Great to see you posting here!

Are you asking whether you can retrieve the value of your Docker image from your flow?

You can use Prefect with any container registry, as long as your execution layer is authenticated to pull that image from the registry. E.g., you could run:


This would authenticate you with your registry, and after that, you could start your Docker agent from the same terminal:

prefect agent docker start --label yourlabel

And this agent should then be able to pull the custom Docker image set on your run config. Does this answer your question or were you asking about something else?

Hi @anna_geller ,

I’m really enjoying to write prefect flows.

You have answered my doubt for sure.

I’ll keep it documented inside my org, but i think it could be stated more clearly on DockerRun documentation page.

I’d add a statement that the only requisite to reference a private registry image is to be authenticated to the registry when starting the agent.

Thanks a lot for the clarification.

1 Like

That’s great to hear! Yeah, I totally understand that. Documentation doesn’t have enough practical examples showing how to work with various infrastructures, registries, etc :smile:

Not sure if this is helpful, but you can have a look at this repo with various examples that may help you build flows with a Docker agent. It also shows how to package your code into a docker image:

Thanks Again @anna_geller , in fact your blog posts and git repositories have been a “first to go” since I started with prefect last year. It has inspired and guided me through more implementation details a lot and are very Helpul!
I’m currently working on my first medium article that will try to capture this little details, I’m expecting to describe creating a custom image with python dependencies and customized python packages installed, use of DockerRun with a image being retrived from nexus and Gitlab storage to pull the flows.
Your blog article Flow of Flows - Orchestrating ELT with Prefect and dbt - Prefect saved me a lot of time.

1 Like

That would be fantastic! If you could share that blog with the community, I’m sure it can help a lot of people trying to solve a similar use case!

And great to hear that my blog was helpful! :heart: