Scr*_*Dev 5 linux postgresql keycloak dnf
通过 microdnf 安装可以使用哪些 PostgreSQL 客户端?我正在尝试通过 Dockerfile 安装客户端。
我尝试了多个我见过的推荐命令和一些猜测,但没有一个对我有用:
microdnf install -y postgresql-client
microdnf install -y postgresql
microdnf install -y psql
etc.
Run Code Online (Sandbox Code Playgroud)
正在使用的图像: https: //hub.docker.com/r/jboss/keycloak/
sh-4.4$ cat /etc/os-release
NAME="Red Hat Enterprise Linux"
VERSION="8.3 (Ootpa)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Red Hat Enterprise Linux 8.3 (Ootpa)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:8.3:GA"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_BUGZILLA_PRODUCT_VERSION=8.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.3"
Run Code Online (Sandbox Code Playgroud)
PS = 我可以访问一个网站来查看可用软件包的完整列表吗?
我有同样的问题,但是使用mavendocker 映像(它基于 OracleLinux 8)。
在上面安装 postgresql 客户端是非常不寻常的,所以,让我们考虑一下我的步骤:
https://www.postgresql.org/download/linux/redhat/
选择RHEL 8并接收rpm包链接
手动安装rpm
microdnf install -y wget
wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm -O /tmp/pg_repo.rpm
rpm -i /tmp/pg_repo.rpm
Run Code Online (Sandbox Code Playgroud)
确定没有postgresql13包。单击直接下载链接并选择 RHEL 8:https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-8-x86_64/
下载postgresql13-13.x.x...包(最新)
wget https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-8-x86_64/postgresql13-13.3-2PGDG.rhel8.x86_64.rpm -O /tmp/pgql.rpm
Run Code Online (Sandbox Code Playgroud)
该 rpm 的依赖项列表:
libicu is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
libpq.so.5()(64bit) is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
postgresql13-libs(x86-64) = 13.3-2PGDG.rhel8 is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
systemd is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
systemd-sysv is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
Run Code Online (Sandbox Code Playgroud)
libicu is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
libpq.so.5()(64bit) is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
postgresql13-libs(x86-64) = 13.3-2PGDG.rhel8 is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
systemd is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
systemd-sysv is needed by postgresql13-13.3-2PGDG.rhel8.x86_64
Run Code Online (Sandbox Code Playgroud)
microdnf install -y systemd postgresql13-libs libicu
Run Code Online (Sandbox Code Playgroud)
现在您可以清除缓存并测试客户端,例如pg_dump命令。
结果 Dockerfile 命令:
RUN microdnf install -y wget && \
wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm -O /tmp/pg_repo.rpm && \
rpm -i /tmp/pg_repo.rpm && \
microdnf install -y systemd postgresql13-libs libicu && \
wget https://download.postgresql.org/pub/repos/yum/13/redhat/rhel-8-x86_64/postgresql13-13.3-2PGDG.rhel8.x86_64.rpm -O /tmp/pgql.rpm && \
rpm -i /tmp/pgql.rpm && \
rm -f /tmp/pg_repo.rpm /tmp/pgql.rpm && \
microdnf remove -y wget
Run Code Online (Sandbox Code Playgroud)
现在让我们考虑一下您的案例,jboss/keycloak:14.0.0基于 RHEL 8 的映像。
注意:如果您收到错误消息error: Failed to create: /var/cache/yum/metadata,请以 root 用户身份运行,然后将用户切换回 jboss。
所有步骤和 Dockerfile 命令都是相同的。
如果有任何错误或描述得不好的地方,请告诉我。
| 归档时间: |
|
| 查看次数: |
6088 次 |
| 最近记录: |