Architektur

Create and use a Docker container with Oracle XE on macOS

This article explains how to create and use a Docker container with an Oracle XE database on macOS. The following steps are very simple and easy. The database setup needs only minutes and works very well for development and testing purposes.

Requirements

Create and Configure the container

1. Navigate to github to get official Docker images for Oracle Software

2. Clone the git repository

3. Download the Oracle XE software from Oracle Technology Network

4. Copy the downloaded file into the folder ../docker-images/OracleDatabase/dockerfiles/11.2.0.2

5. Build the Oracle XE Docker Image (see documentation for more details):

6. Verify the existence of the new image

7. Start a new container with an Oracle XE database

* Note:*

  • Add -v option to the command to specify the data volume to use for the database. Has to be owned by the Unix user „oracle“ or set appropriately. If omitted the database will not be persisted over container recreation.

Use the Oracle XE container

1. Stop the container with docker stop <container id> or start it with docker start <container id>.

2. Connect to the database from macOS using localhost, port 1521 and SID XE. When using another VM on your macOS (example: a JDeveloper environment managed with vagrant) you have to use the IP address of you macOS system instead of localhost when connecting to the database.

Links