Running Oracle in a Docker container on OS X

This guide provides a step-by-step introduction for getting up and running with the Oracle database in a Docker container on OS X.

Step 1: Install Docker

Grab the Docker toolbox  and install it

Step 2: Startup Docker

Run Docker Quickstart Terminal (e.g. by searching for "Docker" in Spotlight)

Step 3: Get the image

We'll use the excellent Docker image by alexeiled - it contains some modifications to make our life easier.

Inside our Docker shell, run

docker pull alexeiled/docker-oracle-xe-11g

to get the image from DockerHub.


Step 4: Startup container

To launch a new container from our image, run

docker run -d -p 49160:22 -p 49161:1521 -p 49162:8080 alexeiled/docker-oracle-xe-11g

You can check which containers are running with

docker ps

Step 5: Connect to our Docker container via SSH

There's a gotcha here: most Docker tutorials assume you're running on a Linux box, where Docker client and Docker server are the same machine. But on OS X, your Docker server is a VirtualBox VM, so none of the usual commands work without modification.

E.g. to connect to our Docker image via SSH, we'd normally use

ssh root@localhost -p 49160

but we'll have to connect to our Docker server instead of localhost:

ssh root@192.168.99.100 -p 49160

(this assumes that the Docker server uses the IP address 192.168.99.100 - when the Docker VM is starting up, it'll tell you which IP address it uses).

Step 6: Logon to Oracle APEX

Now, you can use your Oracle installation. E.g. to log on to APEX, simply open

http://192.168.99.100:49162/apex

in your web browser.



425 Words

2015-12-16T14:11:00.002-08:00