-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using docker image with postgres #924
Comments
It seems to tell you that you're missing some dependencies in order to install psycopg in your docker environment. Specifically, you're missing the It seems that this should solve your issue :
|
Thanks for the quick response @almet, that solved my issue! What do you think about including psycopg2 in the docker image by default? |
Yeah, why not! |
Last time I checked, the psycopg2 binary wheel was not supported on Alpine (because of musl). So, there are two options:
In any case, +1 for supporting postgresql by default in the docker image, the doc needs to be updated in consequence. |
Hey, I tested a few variants:
It seems like using the
Again, since I don't have a lot of experiance using python, I'm not sure whether this is an issue for this project. What do you think? About my test setup: I used the following command to measure build time and size:
The build speed will probably vary depending on your internet connection speed, especially for the second variant, where downloading the additional build-time dependencies takes quite a while. I tested the above builds on a machine with a 100 Mbit/s connection. |
Also tagging @youegraillot who is working on docker-related stuff in #919 |
having Postgre compatibility would be great! |
Thanks for running the numbers! Indeed, the debian-based slim image looks like the best compromise. I don't think the "warning" is particularly relevant for us. @youegraillot I guess it could go in #919 yes! |
#919 is updated I went with adding build dependencies at build and keeping only postgresql-libs for pg_config executable, this is rather standard when needing musl I end up with a 101MB image |
Excellent 👍 There was something in the doc about missing support for postgresql, but it apparently disappeared with the conversion to markdown, so all good here. |
Hey there!
I would like to use the docker image with a PostgreSQL database, but
psycopg2
is not installed in the docker image.I tried adding it afterwards by running from a simple local Dockerfile like this:
But building fails:
There is a lot more output which seems to be pip trying to install previous versions of psycopg2.
I don't have a lot of experience with python, so I'm not really sure how to solve this. Maybe it would be best to install the dependency in the default docker image so it can be used with postgres out of the box?
The text was updated successfully, but these errors were encountered: