Skip to content
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

libpam.so.0 issue in docker #82

Closed
badbyte opened this issue Dec 6, 2021 · 3 comments
Closed

libpam.so.0 issue in docker #82

badbyte opened this issue Dec 6, 2021 · 3 comments

Comments

@badbyte
Copy link

badbyte commented Dec 6, 2021

Embedded postgres can't run in some (all quarkus build images. ex: quay.io/quarkus/ubi-quarkus-native-image:21.3.0-java17) docker images (non-root user)

Process [/tmp/embedded-pg/PG-f2e3e42c260d3a84f6730bd8bccfb393/bin/initdb, -A, trust, -U, postgres, -D, /tmp/epg17377939173514313626, -E, UTF-8] failed

manual run in container gives:
sh-4.4$ /tmp/embedded-pg/PG-f2e3e42c260d3a84f6730bd8bccfb393/bin/initdb -A trust -U postgres -D /tmp/epg17377939173514313626 -E UTF-8

/tmp/embedded-pg/PG-f2e3e42c260d3a84f6730bd8bccfb393/bin/postgres: error while loading shared libraries: libpam.so.0: cannot open shared object file: No such file or directory
no data was returned by command ""/tmp/embedded-pg/PG-f2e3e42c260d3a84f6730bd8bccfb393/bin/postgres" -V"
The program "postgres" is needed by initdb but was not found in the
same directory as "/tmp/embedded-pg/PG-f2e3e42c260d3a84f6730bd8bccfb393/bin/initdb".
Check your installation.

sh-4.4$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.5 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.5"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.5 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8::baseos"
HOME_URL="https://www.redhat.com/"
DOCUMENTATION_URL="https://access.redhat.com/documentation/red_hat_enterprise_linux/8/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"

REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.5
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.5"

@tomix26
Copy link
Collaborator

tomix26 commented Jan 29, 2022

I guess this problem is not caused by an error in postgres binaries, but by a missing package on the target system. Try to execute yum install pam-devel command inside the docker container and let me know it it helped.

@badbyte
Copy link
Author

badbyte commented Feb 7, 2022

There is no way to install anything in quarkus-native containers afaik. That's why the issue was created. Is it possible to add libpam to the embedded-postgres bundle ?

@tomix26
Copy link
Collaborator

tomix26 commented Feb 12, 2022

I think that it isn't. Because the libpam library is system specific and is not present even in regular postgres binaries. So it doesn't make sense to add it to this lightweight bundle.

But it should be quite easy to solve the problem by installing the missing library before running the build. So, for example, instead of calling ./gradlew build you can call yum install pam-devel && ./gradlew build. And this should ensure that the missing library is installed before the gradle build being executed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants