Source: https://itnext.io/oracle-on-arm-mac-m1-m2-docker-images-99ed67ed6ba6
Tested with OrbStack on an M1 Pro MacBook Pro.
-
Clone the official Oracle Docker images repository:
git clone https://github.com/oracle/docker-images
-
Download the Oracle Database 19c aarch64 installer
Download the installer from Oracle Database 19c and put them into the dockerfiles/19.3.0 folder. The needed file is named LINUX.ARM64_1919000_db_home.zip.
-
Build the 19c Enterprise Edition container
cd OracleDatabase/SingleInstance/dockerfiles/ ./buildContainerImage.sh -v 19.3.0 -e
At the end of this script, you should see the image in your Docker images:
oracle/database:19.3.0-ee
-
Check out this fork for the slim fast container
git clone -b 19c-arm-slim https://github.com/marcelo-ochoa/oci-oracle-free cd oci-oracle-free
Note: Make sure to checkout the
19c-arm-slim
branch. -
Build the slim version
docker buildx build --build-arg BUILD_MODE=SLIM -t oracle/database:19.3.0-ee-slim -f Dockerfile.193 .
At the end, you should see this image:
oracle/database:19.3.0-ee-slim
-
Finally build slim-faststart version
docker buildx build --build-arg BASE_IMAGE=oracle/database:19.3.0-ee-slim -t oracle/database:19.3.0-ee-slim-faststart -f Dockerfile.faststart .
At the end, you should see this image:
oracle/database:19.3.0-ee-slim-faststart
-
Use the
oracle/database:19.3.0-ee-slim-faststart
image in your Docker Compose
are you familiar with this issue when running the item number 3 cd OracleDatabase/SingleInstance/dockerfiles/
./buildContainerImage.sh -v 19.3.0 -e
=> ERROR [stage-2 2/4] RUN "/opt/oracle"/oraInventory/orainstRoot.sh && "/opt/oracle/product/19c/dbhome_1"/root.sh 0.2s
1 warning found (use docker --debug to expand):
Dockerfile:130
129 | USER root
130 | >>> RUN "$ORACLE_BASE"/oraInventory/orainstRoot.sh &&
131 | >>> "$ORACLE_HOME"/root.sh
132 |
ERROR: failed to solve: process "/bin/sh -c "$ORACLE_BASE"/oraInventory/orainstRoot.sh && "$ORACLE_HOME"/root.sh" did not complete successfully: exit code: 127