When you setup a Prefect project where it builds a...
# ask-community
g
When you setup a Prefect project where it builds a Docker Container, does it bake the code into that docker image?
1
a
Hey @Gregory Hunt! If you specify
auto
for the
dockerfile
field in your
build_docker_image
step, it will bake your current working directory into the built image. You can use this functionality to bake your flow code into the image. If you would rather not bake your flow code into the built image, you can use your own Dockerfile by providing the relative path to your Dockerfile for the
docker_build_image
step.
g
@alex cool ok i have that working, what command pushes changes to the definitions->work_pools section, i am trying to get the project to update the docker image in the workpool
a
To tell the work pool which Docker image to use for your deployment, you’ll need to update the
job_variables
section under
work_pool
in your
deployment.yaml
. That section will look something like this:
Copy code
work_pool:
    name: my-work-pool
    job_variables:
      image: {{ image_name }}
You can also run
prefect project init --recipe docker
to generate the scaffolding for a Docker-based setup.
g
what command updates the server with the work_ppol changes
since it is not a deployment?
a
When you run
prefect deploy
, the job variables that you specify are saved on the server and used to override the default settings of the work pool the deployment uses.