Using MLE with Docker¶
This beta release of Oracle Database MLE comes as pre-built Docker image.
The docker image is based on the Docker build files as contained in this GitHub repository.
Running the Image¶
The Docker image is available for download as a
tar.gz file from the Oracle Technology Network.
After downloading the image, it needs to be loaded into docker using the docker load command.
$ docker load --input mle-docker-0.3.0.tar.gz
Once loaded, it can be run using the docker run command.
$ docker run --name <container name> \ -p <host port>:1521 -p <host port>:5500 \ -e ORACLE_SID=<your SID> \ -e ORACLE_PDB=<your PDB name> \ -e ORACLE_PWD=<your database passwords> \ -v [<host mount point>:]/opt/oracle/oradata \ -v [<host mount point>:]/home/oracle/myproject \ mle-docker:0.3.0
Note that we are using
ORCLPDB1 as database PDB name throughout the tutorials.
Hence, changing the default PDB name by setting the environment variable
ORACLE_PDB requires replacing the
ORCLPDB1 with the choosen PDB name in the tutorials.
Once the container has been started and the database created you can connect to it just like to any other database:
sqlplus sys/<your password>@//localhost:1521/<your SID> as sysdba sqlplus system/<your password>@//localhost:1521/<your SID> sqlplus pdbadmin/<your password>@//localhost:1521/ORCLPDB1
The Oracle Database inside the container also has Oracle Enterprise Manager Express configured. To access OEM Express, start your browser and follow the URL:
Please note that the run command will not return, i.e. it will block your shell.
Starting and Stopping a Container¶
You can start and stop a container:
$ docker start <container name>
Starting an Interactive Shell¶
In order to deploy stored procedures and user-defined functions, it is necessary to create an interactive shell.
The project that contains the files that should be deployed into the database are typically mounted using a volume at
An interactive shell also allows you run SQL*Plus.
$ docker exec -ti <container name> bash -li
Changing the admin accounts passwords¶
On the first startup of the container a random password will be generated for the database if not provided. You can find this password in the output line:
ORACLE PASSWORD FOR SYS, SYSTEM AND PDBADMIN:
The password for those accounts can be changed via the docker exec command. Note, the container has to be running:
$ docker exec <container name> ./setPassword.sh <your password>