mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-08 02:24:04 +00:00
Fix oracledb recipe
This commit is contained in:
@@ -1,12 +1,8 @@
|
|||||||
FROM jupyter/base-notebook
|
FROM jupyter/base-notebook
|
||||||
|
|
||||||
# Fix: https://github.com/hadolint/hadolint/wiki/DL4006
|
|
||||||
# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014
|
|
||||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
# Install java, javac and alien
|
# Install Java & Oracle SQL Instant Client
|
||||||
RUN apt-get update --yes && \
|
RUN apt-get update --yes && \
|
||||||
apt-get install --yes --no-install-recommends software-properties-common && \
|
apt-get install --yes --no-install-recommends software-properties-common && \
|
||||||
add-apt-repository universe && \
|
add-apt-repository universe && \
|
||||||
@@ -14,34 +10,38 @@ RUN apt-get update --yes && \
|
|||||||
apt-get install --yes --no-install-recommends alien default-jre default-jdk openjdk-11-jdk libaio1 && \
|
apt-get install --yes --no-install-recommends alien default-jre default-jdk openjdk-11-jdk libaio1 && \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/*
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ARG instantclient_major_version=21
|
# Oracle
|
||||||
ARG instantclient_version=${instantclient_major_version}.11.0.0.0-1
|
ARG INSTANTCLIENT_MAJOR_VERSION=21
|
||||||
|
ARG INSTANTCLIENT_VERSION=${INSTANTCLIENT_MAJOR_VERSION}.11.0.0.0-1
|
||||||
|
ARG INSTANTCLIENT_URL=https://download.oracle.com/otn_software/linux/instantclient/2111000
|
||||||
|
|
||||||
# Then install Oracle SQL Instant client, SQL+Plus, tools and JDBC.
|
# Then install Oracle SQL Instant client, SQL+Plus, tools and JDBC.
|
||||||
# Note: You may need to change the URL to a newer version.
|
# Note: You may need to change the URL to a newer version.
|
||||||
# See: https://www.oracle.com/es/database/technologies/instant-client/linux-x86-64-downloads.html
|
# See: https://www.oracle.com/es/database/technologies/instant-client/linux-x86-64-downloads.html
|
||||||
WORKDIR "/tmp"
|
RUN mkdir "/opt/oracle"
|
||||||
RUN short_version="$(echo "${instantclient_version}" | tr -d '.' | cut -d "-" -f1)" && \
|
WORKDIR "/opt/oracle"
|
||||||
instantclient_url="https://download.oracle.com/otn_software/linux/instantclient/${short_version}" && \
|
RUN wget --progress=dot:giga "${INSTANTCLIENT_URL}/oracle-instantclient-basiclite-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
wget --progress=dot:giga "${instantclient_url}/oracle-instantclient-basiclite-${instantclient_version}.el8.x86_64.rpm" && \
|
alien --install --scripts "oracle-instantclient-basiclite-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
alien --install --scripts "oracle-instantclient-basiclite-${instantclient_version}.el8.x86_64.rpm" && \
|
wget --progress=dot:giga "${INSTANTCLIENT_URL}/oracle-instantclient-sqlplus-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
wget --progress=dot:giga "${instantclient_url}/oracle-instantclient-sqlplus-${instantclient_version}.el8.x86_64.rpm" && \
|
alien --install --scripts "oracle-instantclient-sqlplus-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
alien --install --scripts "oracle-instantclient-sqlplus-${instantclient_version}.el8.x86_64.rpm" && \
|
wget --progress=dot:giga "${INSTANTCLIENT_URL}/oracle-instantclient-tools-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
wget --progress=dot:giga "${instantclient_url}/oracle-instantclient-tools-${instantclient_version}.el8.x86_64.rpm" && \
|
alien --install --scripts "oracle-instantclient-tools-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
alien --install --scripts "oracle-instantclient-tools-${instantclient_version}.el8.x86_64.rpm" && \
|
wget --progress=dot:giga "${INSTANTCLIENT_URL}/oracle-instantclient-jdbc-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
wget --progress=dot:giga "${instantclient_url}/oracle-instantclient-jdbc-${instantclient_version}.el8.x86_64.rpm" && \
|
alien --install --scripts "oracle-instantclient-jdbc-${INSTANTCLIENT_VERSION}.el8.x86_64.rpm" && \
|
||||||
alien --install --scripts "oracle-instantclient-jdbc-${instantclient_version}.el8.x86_64.rpm" && \
|
|
||||||
chown -R "${NB_UID}":"${NB_GID}" "${HOME}/.rpmdb" && \
|
chown -R "${NB_UID}":"${NB_GID}" "${HOME}/.rpmdb" && \
|
||||||
rm -f ./*.rpm
|
rm -f ./*.rpm
|
||||||
|
|
||||||
# Configure environment
|
# And configure variables
|
||||||
ENV ORACLE_HOME=/usr/lib/oracle/${instantclient_major_version}/client64
|
RUN echo "ORACLE_HOME=/usr/lib/oracle/${INSTANTCLIENT_MAJOR_VERSION}/client64" >> "${HOME}/.bashrc" && \
|
||||||
ENV PATH="${ORACLE_HOME}/bin:${PATH}"
|
echo "PATH=${ORACLE_HOME}/bin:$PATH" >> "${HOME}/.bashrc" && \
|
||||||
ENV LD_LIBRARY_PATH="${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}"
|
echo "LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}" >> "${HOME}/.bashrc" && \
|
||||||
|
echo "export ORACLE_HOME" >> "${HOME}/.bashrc" && \
|
||||||
|
echo "export PATH" >> "${HOME}/.bashrc" && \
|
||||||
|
echo "export LD_LIBRARY_PATH" >> "${HOME}/.bashrc"
|
||||||
|
|
||||||
# (Optional) Add credentials for the Oracle Database server; files must be present on your `docker build PATH` folder.
|
# Add credentials for /redacted/ using Oracle Db.
|
||||||
WORKDIR /usr/lib/oracle/${instantclient_major_version}/client64/lib/network/admin
|
WORKDIR /usr/lib/oracle/${INSTANTCLIENT_MAJOR_VERSION}/client64/lib/network/admin/
|
||||||
# Adding a wildcard `[]` on the last letter of the filename to avoid throwing an error if the file does not exist.
|
# Add a wildcard `[]` on the last letter of the filename to avoid throwing an error if the file does not exist.
|
||||||
# See: https://stackoverflow.com/questions/31528384/conditional-copy-add-in-dockerfile
|
# See: https://stackoverflow.com/questions/31528384/conditional-copy-add-in-dockerfile
|
||||||
COPY cwallet.ss[o] ./
|
COPY cwallet.ss[o] ./
|
||||||
COPY sqlnet.or[a] ./
|
COPY sqlnet.or[a] ./
|
||||||
|
Reference in New Issue
Block a user