Docker Build Oralce For Mac¶
Run an Oracle Database with Docker Desktop on ARM (M1, M2, M3) MacOS¶
Reference from https://www.simonpcouch.com/blog/2024-03-14-oracle/
Oracle Database 19c Enterprise Edition is now supported on ARM64 platforms. You will have to provide the installation binaries of Oracle Database 19c and put them into the dockerfiles/19.3.0 folder before running the buildContainerImage.sh script.
1. Download Oracle Database¶
Download Oracle Database 19c, listed as Oracle Database 19c (19.19) for LINUX ARM (aarch64). No need to unzip the result .zip file. You’ll need a (free) Oracle account to do so.
2. Clone Oracle’s docker image source¶
Then, clone the oracle/docker-images repository. The repository contains Dockerfiles and samples to build Docker images for a bunch of Oracle’s products, but we’re specifically interested in Oracle Database.
In the repository folder, navigate to OracleDatabase/SingleInstance/dockerfiles/19.3.0 and paste the .zip file you just downloaded there. The install script expects that .zip file to be named LINUX.ARM64_1919000_db_home.zip, as it should be by default.
3. Build the image¶
Change your working directory to OracleDatabase/SingleInstance/dockerfiles/, using
cd OracleDatabase/SingleInstance/dockerfiles/
if you have the docker-images repository as your current working directory. Then, run the following in Terminal:
./buildContainerImage.sh -v 19.3.0 -e
-v 19.3.0 specifies that we’re building the image for version 19.3.0, the version of Oracle Database we’ve downloaded. -e specifies that we want to build the image for the Enterprise Edition, which is the only release that’s currently supported.
4. Running the image¶
You can run the built image by navigating to Images in Docker Desktop and clicking the run button on the oracle/database entry. Set the ORACLE_PWD environmental variable to any value to set the default SYS, SYSTEM, and PDBADMIN passwords. To do so using docker run, write:
docker run -d --name oracle -e ORACLE_PWD=YourPass321 oracle/database:19.3.0-ee
-d indicates that you’ll run in detached mode so that you have access to your terminal.
--name indicates that the container will be named oracle.
-e indicates that the following key=value will be set as an environmental variable.
oracle/database:19.3.0-ee is the name of your image.
Run Oracle In Docker¶
docker run -d --name oracle-db \
-p 1521:1521 -p 5500:5500 \
-e ORACLE_SID=ORCL8276 \
-e ORACLE_PDB=PDB1 \
-e ORACLE_PWD=password \
-e ORACLE_CHARACTERSET=AL32UTF8 \
-e ORACLE_DOMAIN=ottawa.ad.algonquincollege.com \
oracle/database:19.3.0-ee
docker exec -it oracle-db sqlplus / as sysdba