在 docker 容器中安装 oracle 客户端

我使用 alpine linux 作为基础镜像,我需要安装一个 oracle 客户端原生库.我相信你可以从这里下载:

I am using alpine linux as a base image, and I need to install an oracle client native library. I believe you can download from here:

https://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

  1. 看来我必须登录才能下载,有谁知道如何在不登录的情况下下载客户端库的 zip 文件?

  1. it looks like I have to login to download, does anyone know how to download a zip file of the client lib without login?

有谁知道如何在 bash 脚本或 dockerfile 中正确安装客户端库?

does anyone know how to install the client library properly in a bash script or dockerfile?

推荐答案

我想出了一些在 ubuntu Docker 中安装 Oracle 即时客户端的不同方法,它可能对其他人有帮助

I have figure out some different way to install Oracle instant client in ubuntu Docker, it might help others

请按照以下简单步骤操作:

Follow these simple steps:

  1. 从 .rpm 文件)64-downloads.html"rel="noreferrer">oracle官方下载中心

  1. Download oracle instant client (.rpm file) from oracle official download center

转换为 .deb(您可以使用 apt-get install Alien )并移动到您工作目录中的某个位置.

Convert into .deb (you can use apt-get install alien ) and move somewhere in your working directory.

现在更新您的 Dockerfile 并进行构建

Now Update your Dockerfile and make build

RUN apt-get update
WORKDIR /opt
ADD ./ORACLE-INSTANT-CLIENT.deb  /opt
#if libaio also required
RUN apt-get install libaio1 
RUN dpkg -i oracle-instantclient.deb

相关文章