Install oracle client in docker container

user5047085 picture user5047085 · Apr 26, 2019 · Viewed 12k times · Source

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. it looks like I have to login to download, does anyone know how to download a zip file of the client lib without login?

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

Answer

Mohammad Sayeed picture Mohammad Sayeed · Oct 3, 2019

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

Follow these simple steps:

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

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

  3. 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