Home > Mobile >  Can't run Oracle sqlldr in alpine container
Can't run Oracle sqlldr in alpine container

Time:04-29

One of the applications I am helping convert to use a container has a dependency on running sqlldr. I've been going over this page:

https://docs.oracle.com/en/database/oracle/oracle-database/21/lacli/install-instant-client-using-zip.html#GUID-D3DCB4FB-D3CA-4C25-BE48-3A1FB5A22E84

To install the Oracle Instant Client. In my dockerfile I have:

FROM alpine:3.15

RUN wget https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-basiclite-linux.x64-21.6.0.0.0dbru.zip
RUN wget https://download.oracle.com/otn_software/linux/instantclient/216000/instantclient-tools-linux.x64-21.6.0.0.0dbru.zip
RUN unzip instantclient-basiclite-linux.x64-21.6.0.0.0dbru.zip -d /opt/oracle/
RUN unzip instantclient-tools-linux.x64-21.6.0.0.0dbru.zip -d /opt/oracle/
RUN apk add libaio
ENV PATH="/opt/oracle/instantclient_21_6:${PATH}"
ENV LD_LIBRARY_PATH="/opt/oracle/instantclient_21_6"
RUN mkdir -p /etc/ld.so.conf.d
RUN echo /opt/oracle/instantclient_21_6 > /etc/ld.so.conf.d/oracle-instantclient.conf

...

I see sqlldr in the directory, but it doesn't run.

-rwxr-xr-x    1 root     root       1680648 Apr 28 01:18 sqlldr
-rw-r--r--    1 root     root       1797774 Apr 28 01:18 ucp.jar
-rwxr-xr-x    1 root     root        235976 Apr 28 01:18 uidrvci
-rwxr-xr-x    1 root     root        831856 Apr 28 01:18 wrc
-rw-r--r--    1 root     root         74603 Apr 28 01:18 xstreams.jar
/opt/oracle/instantclient_21_6 # sqlldr
/bin/sh: sqlldr: not found

Does anyone have an example of installing sqlldr from instant client on to an alpine image?

CodePudding user response:

Have you checked this Dockerfile for an example? And maybe this one as well and this. All three look like they could help in your case.

  • Related