For those who are Docker familiar, why would this ...
# pacc-london-2023
g
For those who are Docker familiar, why would this Dockerfile not be installing the requirements.txt file? If I specify
python -m pip install my_module
it works fine so it’s not pip, but the requirements.txt isn’t being picked up.
Copy code
# DockerFile
FROM prefecthq/prefect:2.10.16-python3.10
COPY requirements.txt /opt/prefect/prefect_training/requirements.txt
RUN python -m pip install -r requirements.txt
COPY . /opt/prefect/prefect_training/
WORKDIR /opt/prefect/prefect_training/
@Nate: this is the working Dockerfile
Copy code
FROM prefecthq/prefect:2.10.16-python3.10
COPY . /opt/prefect/prefect_training/
WORKDIR /opt/prefect/prefect_training/
RUN python -m pip install -r requirements.txt
n
thank you!
👍 1
n
I had the same issue
g
In case it helps, the solution we came up with (thanks to @Taylor Curran and Nate) is to have the following:
Copy code
# prefect.yaml

...
build:
  - prefect_docker.deployments.steps.build_docker_image:
      id: build_image
      requires: prefect-docker>=0.3.0
      image_name: my-image-name/demo
      tag: 0.0.1
      dockerfile: Dockerfile
      push: false
...
Copy code
# Dockerfile

FROM prefecthq/prefect:2.10.16-python3.10
COPY . /opt/prefect/prefect_training/
WORKDIR /opt/prefect/prefect_training/
RUN python -m pip install -r requirements.txt
👍 1
thank you 1