Skip to content

Instantly share code, notes, and snippets.



Last active Aug 9, 2018
What would you like to do?
Getting Oracle Enterprise in a Container AND installing client libraries

Team member was fighting trying to get a docker container for Oracle setup on his Mac as there's a lot of confusing and conflicting information out there. This was tried and tested!

You will need to aquire access to the container via the standard Oracle data grab here.

$ docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to to create one.
Username (17twenty): 
Login Succeeded
$ docker pull store/oracle/database-enterprise: # This will take an age
$ docker run -d -it --name oracleDB -p 1521:1521 -p 5500:5500 store/oracle/database-enterprise:
$ You can specify a config to override all the Oracle defaults but let's start with a working setup first.

Download sqlplus and support bins from Oracle's site - I grabbed some creds from bugmenot (no, I didn't make this part up):

Password: FUoracle1

You'll need to install the following with brew:

  • instantclient-basic-macos.x64–
  • instantclient-sqlplus-macos.x64–

Move them to ~/Library/Caches/Homebrew

$ brew tap InstantClientTap/instantclient
$ brew install instantclient-basic
$ brew install instantclient-sqlplus

You'll need a file called tnsnames.ora in a folder, say oracle. It should look like this:

$ less oracle/tnsnames.ora

Now finally...

$ export TNS_ADMIN=./oracle
$ sqlplus sys/Oradoc_db1@ORCLCDB as sysdba 

SQL*Plus: Release Production on Thu Aug 9 13:45:39 2018

Copyright (c) 1982, 2017, Oracle.  All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release - 64bit Production


Oradoc_db1 is the default password, you can change this nonsense with a config passed in. The Oracle doco on Docker hub can expand more.

You're done!


This comment has been minimized.

Copy link

@mike-watkins-versent mike-watkins-versent commented Aug 9, 2018

This is amazing - thank you!

Small correction, change;
$ less oracle/tnsname.ora
$ less oracle/tnsnames.ora

This fixes an error you will receive when connecting...
ERROR: ORA-12154: TNS:could not resolve the connect identifier specified


This comment has been minimized.

Copy link
Owner Author

@17twenty 17twenty commented Aug 9, 2018

fixed ta - cleanup gone wrong 👍

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.