Skip to content

Commit

Permalink
Add OL8 Dockerfile for Instant Client 19 (oracle#1770)
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Jones <[email protected]>
  • Loading branch information
cjbj authored Oct 30, 2020
1 parent 88242bb commit de61316
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 25 deletions.
75 changes: 52 additions & 23 deletions OracleInstantClient/README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,81 @@
# About this Container Image

These container images are for the Oracle Instant Client 'Basic', 'SDK' and 'SQL\*Plus' packages. They can be used to build and run Oracle Call Interface (OCI), Oracle C++ Call Interface (OCCI), and JDBC-OCI applications applications. The SQL\*Plus command-line query tool allows quick ad-hoc SQL and PL/SQL execution. The container images can be extended with optional packages for ODBC, or to include tools such as Oracle SQL\*Loader.

The base images support building and using scripting language APIs that internally call OCI. These include [Python's cx_Oracle](https://yum.oracle.com/oracle-linux-python.html), [Node.js's node-oracledb](https://yum.oracle.com/oracle-linux-nodejs.html), [PHP's OCI8](https://yum.oracle.com/oracle-linux-php.html), [Go's goracle](https://github.com/go-goracle/goracle) and [Ruby's ruby-oci8](https://www.rubydoc.info/github/kubo/ruby-oci8).
These container images are for the Oracle Instant Client 'Basic', 'SDK' and
'SQL\*Plus' packages. They can be used to build and run Oracle Call Interface
(OCI), Oracle C++ Call Interface (OCCI), and JDBC-OCI applications applications.
The SQL\*Plus command-line query tool allows quick ad-hoc SQL and PL/SQL
execution. The container images can be extended with optional Instant Client
packages for ODBC, or to include tools such as Oracle SQL\*Loader.

The base images support building and using scripting language APIs that
internally call OCI. These include [Python's
cx_Oracle](https://yum.oracle.com/oracle-linux-python.html), [Node.js's
node-oracledb](https://yum.oracle.com/oracle-linux-nodejs.html), [PHP's
OCI8](https://yum.oracle.com/oracle-linux-php.html), [Go's
godror](https://godror.github.io/godror/) and [Ruby's
ruby-oci8](https://www.rubydoc.info/github/kubo/ruby-oci8).

## About Oracle Instant Client

The [Oracle Instant Client](https://www.oracle.com/technetwork/database/features/instant-client/) is a repackaging of Oracle Database libraries, tools and header files usable to create and run applications that connect to a remote (or local) Oracle Database.

Oracle client-server version interoperability is detailed in [Doc ID 207303.1](https://support.oracle.com/epmos/faces/DocumentDisplay?id=207303.1). In summary, applications using Oracle Call Interface (OCI) 19, 18 and 12.2 can connect to Oracle Database 11.2 or later. Some tools may have other restrictions.
The [Oracle Instant
Client](https://www.oracle.com/database/technologies/instant-client.html) is a
repackaging of Oracle Database libraries, tools and header files usable to
create and run applications that connect to a remote (or local) Oracle Database.

From release 18.3, the Oracle Instant Client RPMs for Oracle Linux are available for direct download from the [Oracle Linux yum server](https://yum.oracle.com) without requiring manual license acceptance.
Oracle client-server version interoperability is detailed in [Doc ID
207303.1](https://support.oracle.com/epmos/faces/DocumentDisplay?id=207303.1).
In summary, applications using Oracle Call Interface (OCI) 19, 18 and 12.2 can
connect to Oracle Database 11.2 or later. Some tools may have other
restrictions.

## Building the Oracle Instant Client 19 Image
## Building the Oracle Instant Client 19 Images

Change directory to [`dockerfiles/19`](dockerfiles/19) and run:
Change directory to [`oraclelinux7/19`](oraclelinux7/19) or
[`oraclelinux8/19`](oraclelinux8/19)and run:

```
docker build --pull -t oracle/instantclient:19 .
```

The build process automatically installs Instant Client using RPMs directly from the [Oracle Instant Client repository](https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/index.html) on the [Oracle Linux yum server](https://yum.oracle.com).
The build process automatically installs Instant Client using RPMs directly from
the [Oracle Instant Client repository
(OL7)](https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/index.html)
or [Oracle Instant Client repository
(OL8)](https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/index.html).

Applications using Oracle Call Interface (OCI) 19 can connect to
Oracle Database 11.2 or later. Some tools may have other
restrictions.

## Building the Oracle Instant Client 18 Image
## Building the Oracle Instant Client 18 Image for Oracle Linux 7

Change directory to [`dockerfiles/18`](dockerfiles/18) and run:
Change directory to [`oraclelinux7/18`](oraclelinux7/18) and run:

```
docker build --pull -t oracle/instantclient:18 .
```

The build process will automatically install the Instant Client using RPMs sourced directly from the [Oracle Instant Client repository](https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/index.html) on the [Oracle Linux yum server](https://yum.oracle.com).
The build process will automatically install the Instant Client using RPMs
sourced directly from the [Oracle Instant Client
repository](https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/index.html).

Applications using Oracle Call Interface (OCI) 18 can connect to
Oracle Database 11.2 or later. Some tools may have other
restrictions.

## Building the Oracle Instant Client 12.2 Image
## Building the Oracle Instant Client 12.2 Image for Oracle Linux 7

Download the following three RPMs from the [Instant Client download page](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html) on the Oracle Technology Network:
Download the following three RPMs from the [Instant Client download
page](https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html)
on the Oracle Technology Network:

- `oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm`
- `oracle-instantclient12.2-devel-12.2.0.1.0-1.x86_64.rpm`
- `oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm`

Place the downloaded Oracle Instant Client RPMs (from the previous step) in the
[`dockerfiles/12.2.0.1`](dockerfiles/12.2.0.1) directory, then switch to that directory and run:
[`oraclelinux7/12.2.0.1`](oraclelinux7/12.2.0.1) directory, then switch to that
directory and run:

```
docker build --pull -t oracle/instantclient:12.2.0.1 .
Expand Down Expand Up @@ -103,15 +129,18 @@ mounts](https://docs.docker.com/storage/bind-mounts/).
If you have a wallet zip downloaded from an Oracle Cloud Database then you
should unzip it and, in this example, place the extracted files in
`/my/host/wallet_dir` on your host. Cloud database wallets provide connection
strings for the database service and enable TLS. Your container applications
should use one of the connection strings from `tnsnames.ora` and also supply a
valid database username and password for connection. If you are using C based
applications (including database drivers for Python, Node.js, Go, Ruby or PHP)
you only need the `tnsnames.ora`, `sqlnet.ora` and `cwallet.sso` files from the
zip file. Keep the files secure.
strings for the database service and enable mutual TLS. Your container
applications should use one of the connection strings from `tnsnames.ora` and
also supply a valid database username and password for connection. If you are
using C based applications (including database drivers for Python, Node.js, Go,
Ruby or PHP) you only need the `tnsnames.ora`, `sqlnet.ora` and `cwallet.sso`
files from the zip file. Keep the files secure.

## Adding Oracle Database Drivers

To extend the image with optional Oracle Database drivers, follow your desired driver installation steps. The Instant Client libraries are in `/usr/lib/oracle/<version>/client64/lib` and the Instant Client headers are in `/usr/include/oracle/<version>/client64/`.
To extend the image with optional Oracle Database drivers, follow your desired
driver installation steps. The Instant Client libraries are in
`/usr/lib/oracle/<version>/client64/lib` and the Instant Client headers are in
`/usr/include/oracle/<version>/client64/`.

The Instant Client libraries are in the default library search path.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# Execute:
# $ docker build --pull -t oracle/instantclient:19 .
# $ docker run -ti --rm oracle/instantclient:19 sqlplus [email protected]/orclpdb1
# $ docker run -ti --rm oracle/instantclient:19 sqlplus -l [email protected]/orclpdb1
#
# NOTES
# -----
Expand Down Expand Up @@ -44,7 +44,8 @@
# ORACLE INSTANT CLIENT PACKAGES
# ------------------------------
#
# Instant Client Packages are available from https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/index.html
# Instant Client Packages for Oracle Linux 7 are available from
# https://yum.oracle.com/repo/OracleLinux/OL7/oracle/instantclient/x86_64/index.html
#
# Base - one of these packages is required to run applications and tools
# oracle-instantclientXX.Y-basic : Basic Package - All files required to run OCI, OCCI, and JDBC-OCI applications
Expand Down
79 changes: 79 additions & 0 deletions OracleInstantClient/oraclelinux8/19/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# LICENSE UPL 1.0
#
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
#
# Container image template for Oracle Instant Client
#
# HOW TO BUILD THIS IMAGE AND RUN A CONTAINER
# --------------------------------------------
#
# Execute:
# $ docker build --pull -t oracle/instantclient:19 .
# $ docker run -ti --rm oracle/instantclient:19 sqlplus [email protected]/orclpdb1
#
# NOTES
# -----
#
# Applications using Oracle Call Interface (OCI) 19 can connect to
# Oracle Database 11.2 or later. Some tools may have other
# restrictions.
#
# Oracle Instant Client 19 automatically configures the global library search
# path to include Instant Client libraries.
#
# OPTIONAL ORACLE CONFIGURATION FILES
# -----------------------------------
#
# Optional Oracle Network and Oracle client configuration files can be put in the
# default configuration file directory /usr/lib/oracle/<version>/client64/lib/network/admin.
# Configuration files include tnsnames.ora, sqlnet.ora, oraaccess.xml and
# cwallet.sso. You can use a Docker volume to mount the directory containing
# the files at runtime, for example:
#
# docker run -v /my/host/wallet_dir:/usr/lib/oracle/19.9/client64/lib/network/admin:Z,ro . . .
#
# This avoids embedding private information such as wallets in images. If you
# do choose to include network configuration files in images, you can use a
# Dockerfile COPY, for example:
#
# COPY tnsnames.ora sqlnet.ora /usr/lib/oracle/${release}.${update}/client64/lib/network/admin/
#
# There is no need to set the TNS_ADMIN environment variable when files are in
# the container's default configuration file directory, as shown.
#
# ORACLE INSTANT CLIENT PACKAGES
# ------------------------------
#
# Instant Client Packages for Oracle Linux 8 are available from
# https://yum.oracle.com/repo/OracleLinux/OL8/oracle/instantclient/x86_64/index.html
#
# Base - one of these packages is required to run applications and tools
# oracle-instantclientXX.Y-basic : Basic Package - All files required to run OCI, OCCI, and JDBC-OCI applications
# oracle-instantclientXX.Y-basiclite : Basic Light Package - Smaller version of the Basic package, with only English error messages and Unicode, ASCII, and Western European character set support
#
# Tools - optional packages (requires the 'basic' package)
# oracle-instantclientXX.Y-sqlplus : SQL*Plus Package - The SQL*Plus command line tool for SQL and PL/SQL queries
# oracle-instantclientXX.Y-tools : Tools Package - Includes Data Pump, SQL*Loader and Workload Replay Client
#
# Development and Runtime - optional packages (requires the 'basic' package)
# oracle-instantclientXX.Y-devel : SDK Package - Additional header files and an example makefile for developing Oracle applications with Instant Client
# oracle-instantclientXX.Y-jdbc : JDBC Supplement Package - Additional support for Internationalization under JDBC
# oracle-instantclientXX.Y-odbc : ODBC Package - Additional libraries for enabling ODBC applications
#

FROM oraclelinux:8-slim

LABEL "provider"="Oracle" \
"issues"="https://github.com/oracle/docker-images/issues"

ARG release=19
ARG update=9

RUN microdnf install oracle-release-el8 && \
microdnf install oracle-instantclient${release}.${update}-basic oracle-instantclient${release}.${update}-devel oracle-instantclient${release}.${update}-sqlplus && \
microdnf clean all

# Uncomment if the tools package is added
# ENV PATH=$PATH:/usr/lib/oracle/${release}.${update}/client64/bin

CMD ["sqlplus", "-v"]

0 comments on commit de61316

Please sign in to comment.