【问题标题】:Docker node-oracledb image build runs into conflict Oracle Instant Client versionDocker node-oracledb 镜像构建运行冲突 Oracle Instant Client 版本
【发布时间】:2020-06-25 18:14:08
【问题描述】:

我不是一个非常精明的 docker 开发人员,并且作为我公司文档教程的一部分,我在尝试使用 docker build . -t image_name 构建 docker 映像时遇到了一个问题。

问题似乎是在抱怨Oracle InstantClient 的两个不同版本之间的冲突。我想知道是否有任何有经验的人可以帮助我。

Loaded plugins: ovl
Resolving Dependencies
--> Running transaction check
---> Package node-oracledb-node12.x86_64 0:4.1.0-1.el7 will be installed
--> Processing Dependency: oracle-instantclient19.3-basic >= 19.3.0.0.0 for package: node-oracledb-node12-4.1.0-1.el7.x86_64
---> Package nodejs.x86_64 0:12.18.1-1.0.1.el7 will be installed
--> Running transaction check
---> Package oracle-instantclient19.3-basic.x86_64 0:19.3.0.0.0-1 will be installed
--> Processing Conflict: oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64 conflicts libclntsh.so.19.1
--> Processing Conflict: oracle-instantclient19.3-basic-19.3.0.0.0-1.x86_64 conflicts libclntsh.so.19.1
--> Finished Dependency Resolution
Error: oracle-instantclient19.5-basic conflicts with oracle-instantclient19.3-basic-19.3.0.0.0-1.x86_64
Error: oracle-instantclient19.3-basic conflicts with oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
The command '/bin/sh -c yum -y install oracle-release-el7 && yum-config-manager --enable ol7_oracle_instantclient     && yum -y install oracle-instantclient${release}.${update}-basic oracle-instantclient${release}.${update}-devel oracle-instantclient${release}.${update}-sqlplus     && yum install -y oracle-nodejs-release-el7 oracle-release-el7     && yum-config-manager --enable ol7_developer_nodejs12     && yum -y install nodejs node-oracledb-node12     && rm -rf /var/cache/yum     && yum -y upgrade' returned a non-zero code: 1

我的 dockerfile 的主要部分如下:

FROM oraclelinux:7-slim

ARG release=19
ARG update=5

RUN yum -y install oracle-release-el7 && yum-config-manager --enable ol7_oracle_instantclient \
    && yum -y install oracle-instantclient${release}.${update}-basic --skip-broken oracle-instantclient${release}.${update}-devel oracle-instantclient${release}.${update}-sqlplus \
    && yum install -y oracle-nodejs-release-el7 oracle-release-el7 \
    && yum-config-manager --enable ol7_developer_nodejs12 \
    && yum -y install nodejs node-oracledb-node12 \
    && rm -rf /var/cache/yum \
    && yum -y upgrade

【问题讨论】:

  • 该问题与 Docker 无关。使用yum 查看您正在安装的内容。这就是问题所在。
  • 猜你正在尝试构建节点 docker 容器在此处关注instructions

标签: oracle docker conflict node-oracledb instantclient


【解决方案1】:

Oracle Linux 小组在最后一天左右推出了一些更新的 Dockerfile。 Node.js 12 文件位于https://github.com/oracle/docker-images/blob/master/OracleLinuxDevelopers/oraclelinux7/nodejs/12-oracledb/Dockerfile

另见 docker 的 node-oracledb 安装说明:https://oracle.github.io/node-oracledb/INSTALL.html#docker

并查看博文系列https://blogs.oracle.com/opal/docker-for-oracle-database-applications-in-nodejs-and-python-part-1

你可以试试:

FROM oraclelinux:7-slim

RUN yum -y install oracle-nodejs-release-el7 oracle-release-el7 && \
    yum -y install nodejs node-oracledb-node12 && \
    rm -rf /var/cache/yum/*

ENV NODE_PATH=/usr/lib/node_modules

CMD ["/bin/node", "-v"]

【讨论】:

  • 嘿@Christopher-jones,感谢您的洞察力。我已经编辑了我的问题并添加了我的 docker 文件的主要部分。由于我不是一个非常有经验的 docker 用户,而且我很着急,你介意看看它并更具体地调整你的回应吗?
  • 除了yum -y upgrade(在rm 之前你会这样做),我的回答已经满足了我认为你想要的。试一试。
猜你喜欢
  • 2018-02-23
  • 2020-10-06
  • 1970-01-01
  • 2018-09-28
  • 2021-04-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多