Docker for Oracle SQL*Plus

This article is part of a series on using Docker for CLI tools. You can read the original article {% post_link using-docker-for-cli-applications here %}.

Oracle SQL*Plus is the Command Line (CLI) tool to connect to Oracle. It is part of the Oracle Instant Client set of tools. I've always found the installation process to be cumbersome as it requires a few steps (not a straight install or base executable like SQLcl).

Oracle has made the Instant Client files now available on a pre-built Docker image. This article covers how to download the Docker image and use it to run SQl*Plus in a container rather than a local install.

Accept License Agreements

Oracle has its own container registry. Before using any of their pre-built images you must accept the license agreements (this only has to be done once).

  • Go to container registry
  • Search for instantclient (all one word)
    • Select the instantclient link
  • Sign In (image below) and accept the license agreements

{% asset_img oracle-container-registry.png %}

Docker Login to Oracle's Container Registry

In your terminal run:

docker login

You will be required to enter in your Oracle SSO login credentials (only need to do this once).

Setup sqlplus alias

In ~/.bash_profile or ~/.zshrc add the following alias

alias sqlplus='docker run -it --rm \
  -e ORACLE_PATH=/oracle/ \
  -w /myhost \
  --network="host" \
  -v ~/Documents/Oracle/:/oracle/ \
  -v `pwd`:/myhost \ \
  sqlplus '

Run SQL*Plus

Start a new terminal (so the alias is registered) and just run sqlplus as you normally would.


The current image from Oracle is using Instant Client where as at the time of writing the most current version is If you want to build your own image so you can run the latest version, you can use Oracle's Docker Image files (just search for the version you want).