-1

I need to run a Docker container running python code that can make a connection to an existing PostgreSQL ver 15.2 database.

I have successfully done this with

FROM fedora:36

installing these packages like so

RUN dnf -y upgrade --refresh \
    && dnf clean all \
    && dnf -y install dnf-plugins-core glibc gcc \
          python3 python3-pip python3-devel \
    && dnf module enable postgresql:14 -y \
    && dnf -y install postgresql-14.3-1.module_f36+14654+ca9d57a5.x86_64 \
    && dnf clean all

That works and provides a PostgreSQL client and the psql executable

And then in requirements.txt simply

psycopg


Now I want to upgrade Fedora to:

FROM fedora:37

but after searching and trying many things, I cannot find the correct module to install to make it work for Fedora 37 and PostgreSQL ver 15.2

For fedora:36, it was: postgresql-14.3-1.module_f36+14654+ca9d57a5.x86_64


How do I find the equivalent for Fedora 37?


PostgreSQL is not running in a Docker container anywhere, it is external.

Has anyone been successful at accomplishing this?

user10664542
  • 1,106
  • 1
  • 23
  • 43

1 Answers1

0

So, you are need to change Fedora verion in 'FROM' clause, module version in 'module enable' clause, and no necessary to use full postgresql package name generally, short name should be enough i believe. Seems it should be something like:

FROM fedora:37

RUN dnf -y upgrade --refresh \
    && dnf clean all \
    && dnf -y install dnf-plugins-core glibc gcc \
          python3 python3-pip python3-devel \
    && dnf -y module enable postgresql:15 \
    && dnf -y install postgresql \
    && dnf clean all
Rabban Keyak
  • 220
  • 2
  • 6