Creating an Oracle Database Container

floppy disk

Instructions

First, clone this GitHub repo. The necessary files to set up this container will be found in the /containers/oracle directory, and the most up-to-date instructions can be found in the associated README.

Then, follow the instructions below for creating a new Oracle database container using existing dumps of your Oracle database.

Deploy a database to Oracle container

  • OPTIONAL: If using podman, verify a podman machine has been created with your $HOME directory mounted
    • podman machine init --cpus=5 --memory=10240 -v $HOME:$HOME --rootful
  • Log in to the Oracle Container Registry
    • docker login container-registry.oracle.com
  • Pull down the Oracle 19 Enterprise Docker image
    • Use this image for AMD64 systems (Intel x86)
      • docker pull container-registry.oracle.com/database/enterprise:19.3.0.0
    • Use this image 19 for ARM64 systems (Mac M1/M2/M3)
      • docker pull container-registry.oracle.com/database/enterprise:19.19.0.0
  • Copy any needed database dumps *.dmp files to the setup/ directory
  • Grant read+write file permissions to the setup directory
    • chmod -R 777 setup
  • Create an oradata volume to mount to the Oracle container
    • docker volume create --label version=19 oradata
  • Build the Oracle container image
    • docker run --name oracle-db \
          -p 1521:1521 \
          -e ORACLE_PWD=Welcome1 \
          -e ORACLE_EDITION=enterprise \
          -v oradata:/opt/oracle/oradata \
          # mount scripts and database dumps to setup database
          -v /Users/path/to/containers/oracle/setup:/opt/oracle/scripts/setup \
          container-registry.oracle.com/database/enterprise:19.19.0.0