Oracle on Alpine linux

社会主义新天地 提交于 2019-12-01 17:56:17

I'd recommend using an operating system supported by Oracle, thus avoiding the headache of hacking Alpine and the uncertainty that it won't fall over at a critical time. And thus giving you some confidence your business won't be negatively impacted. Try https://github.com/oracle/docker-images/tree/master/OracleInstantClient

Other comments

  • Don't set ORACLE_HOME when using Instant Client. That variable is for full software installs.
  • Use ldconfig to set the system library path, see the Instant Client installation instructions e.g. here.
  • Use Instant Client 18.3, which can connect to the same DB versions that 12.2 can. (18.3 is really the renamed 12.2.0.2 in the new versioning system)
  • Using Oracle Linux Docker images has the advantage that it will download and install the 18.3 Instant Client without you having to manually do the download.

See this blog for info about the 'slim' Oracle Linux container it uses.

I might be late to answer this. I got the same problem of having a alpine base image and add oracle client to that. So i came up with this solution - https://github.com/Shrinidhikulkarni7/OracleClient_Alpine

Here is the Dockerfile, but you would also need the shell script in it for it to work.

FROM alpine:latest

ENV LD_LIBRARY_PATH=/lib

RUN wget https://download.oracle.com/otn_software/linux/instantclient/193000/instantclient-basic-linux.x64-19.3.0.0.0dbru.zip && \
    unzip instantclient-basic-linux.x64-19.3.0.0.0dbru.zip && \
    cp -r instantclient_19_3/* /lib && \
    rm -rf instantclient-basic-linux.x64-19.3.0.0.0dbru.zip && \
    apk add libaio

ADD script.sh /root/script.sh

RUN /root/script.sh

Over here I'm directly downloading the oracle client inside image, setting the path, adding packages and finally using the shell script for creating symbolic link.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!