Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Dockerfile to build an image for Perl connecting with an Oracle DB via the InstantClient
FROM store/oracle/database-instantclient:12.2.0.1
# I believe one needs to be authenticated to DockerHub to use this image.
# Oracle Linux is RPM based, and these are the requirements for a basic CPAN install for this
RUN yum install -y \
gcc \
gzip \
perl \
perl-App-cpanminus \
perl-DBI \
perl-Test-Simple \
tar \
&& yum clean all
# For some reason, the demo.mk can't be found by the CPAN install of DBD::Oracle unless you link it in.
RUN ln -sv /usr/share/oracle/12.2/client64/demo/demo.mk /usr/share/oracle/12.2/client64/demo.mk
ENV ORACLE_HOME /usr/lib/oracle/12.2/client64
ENV LD_LIBRARY_PATH /usr/lib/oracle/12.2/client64/lib
ENV PATH $PATH:$HOME/bin:/usr/lib/oracle/12.2/client64/bin
# This is the basic CPAN library that's needed. If your script needs more things from CPAN, you
# can add them here or add additional "RUN cpanm install ..." lines to have them installed.
RUN cpanm install \
DBD::Oracle
COPY my_script.pl /
# Comment out the lines below to run an interactive session, or use docker run --entrypoint bash ...
ENTRYPOINT /my_script.pl
CMD "--help"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.