I’m trying to make a docker image that’ll allow me...
# prefect-community
I’m trying to make a docker image that’ll allow me to run my flows within it. I attempted to use
as the base image, but encountered pyscopg2 installation issues, so I decided to just pip install prefect within the image. The example below is super basic (just want to be able to run a
command). However, when I run the image, I get the following error:
/bin/sh: 1: prefect: not found
I’ve also attempted the following variations in place of the
CMD prefect version
command: •
RUN ["/bin/bash", "-c", "prefect version"]
CMD ["prefect", "version"]
Any ideas? 😄
Hi @Viv Ian - I’ll try to recreate; in the meantime could you share the
error you ran into? We use our base images all over the place so I’d be surprised if there was something corrupt in them, but if so we’d want to know ASAP
Hi @Viv Ian I am unable to recreate your issue; building and running a Docker container off the file you included worked well for me and outputted
Are you running on a Windows machine by any chance?
Hi Chris, I’m running on a Mac. Apologies for the omission. The
error is raised when attempting to pip install the
package within
. The error is below:
Hi @Viv Ian this error is unrelated to Prefect; if you look closely at the traceback, it suggests you try to install
instead of
, otherwise you’ll need to install
into this image
Hi @Chris White totes understand this isn’t a prefect error. This was the error I was getting when attempting to use prefect as the base image, so I wanted to go about using a different base image and creating my own Dockerfile. Wasn’t sure if this was something anyone else had run into. 😅
ah gotcha gotcha
Figured out the issue and posting here in case anyone encounters in the future…just gotta add this line in the Dockerfile before installing whatever needs psycopg2:
RUN apt-get update && apt-get install -y postgresql libpq-dev postgresql-client postgresql-client-common
Awesome - I’ll archive this thread to GitHub so anyone else with this issue can find it!
👍 1
@Marvin archive “Issue installing psycopg2 in Prefect Docker image”