How to configure the pull step for a project building a docker image?

Hello, I’m trying the new project feature, but can’t get the last step to work.

I configured my prefect.yaml to build and push a custom image into a private docker registry. Build is successful, I can see my image in my repository, and it appears in Prefect UI. But when I run it, it fails to find the code to run:

FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/flow'

  • prefect.yaml :
name: flow
prefect-version: 2.10.4

- prefect_docker.projects.steps.build_docker_image:
    requires: prefect-docker>0.1.0
    image_name: xxx/orion
    tag: test-1.0
    dockerfile: Dockerfile
    push: True
    credentials: "{{ prefect.blocks.docker-registry-credentials.docker-hub }}"

- prefect.projects.steps.set_working_directory:
    directory: /opt/prefect/flow

  • deployment.yaml:
# base metadata
name: hello-world-deploy
version: null
tags: []
description: null
schedule: null

# flow-specific fields
#flow_name: check
path: null
parameters: {}
parameter_openapi_schema: null

# infra-specific fields
  name: my-pool
  work_queue_name: default
  job_variables: {}
  • Dockerfile:
FROM xxx/prefect:base-3.10

COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY ./* /opt/prefect/flow/

From my understanding, the pull step is executed outside of the docker container, as I inspected the image and files are visible. Removing the pull doesn’t seem to be an option either, any help is appreciated :slight_smile:

To anyone finding this thread, I resolved it (thanks Prefect slack community):

In deployment.yaml:

  name: my-work-pool
    image: ' {{ image_name }} '

As my image wasn’t actually being pulled by the worker.

Also, I use a kubernetes worker and I had to change ImagePullPolicy to always and make sure CLI and docker image were both to latest version :slight_smile: