<@ULVA73B9P> With Prefect 3.0, I want to create a ...
# ask-marvin
n
@Marvin With Prefect 3.0, I want to create a
prefect.yaml
file to deploy a flow. The flow uses an existing Docker image so it shouldn't be build. How do I add
build = False
in the configuration?
m
You can configure the
prefect.yaml
file to avoid building a Docker image by setting the
build
section to
null
or simply not including it at all. Here’s an example configuration where the flow uses an existing Docker image without building it:
Copy code
yaml
name: my_project
prefect-version: 3.0.0

build: null   # This ensures no build steps are executed

push: null    # No push steps required

pull:
  - prefect.deployments.steps.git_clone:
      repository: <https://gitlab.com/your_repository.git>
      credentials: "{{ prefect.blocks.gitlab-credentials.your_credentials }}"

deployments:
  - name: my_deployment
    flow_name: my_flow
    tags: []
    work_pool:
      name: default-agent-pool
      variables: {}
    infrastructure:
      type: docker
      image: your_existing_docker_image
This configuration sets the
build
field to
null
to skip the build process and uses an existing Docker image specified in the
deployments
section. For more details, you can refer to Prefect's documentation on defining deployments with YAML, where you can find additional examples and options.