- Prerequisites
- Version Info
- How to Install
- Connecting to the Database
- Optional Settings
- Alternative Install
- Docker Terms
- Have Docker Installed
- Create an account & test login to Oracle Image Registry
docker login container-registry.oracle.com
docker pull container-registry.oracle.com/database/express:latest
docker pull container-registry.oracle.com/database/ords:latest
Note: Its best to review details on Oracle container registry website, but pulling latest images as of (11-22-2022) from oracle will have the following versions:
APEX Environment | ORDS | Oracle Database |
---|---|---|
APEX 22.1.0 | ORDS 22.3.1 | Oracle Database XE Release 21c (21.3.0.0) |
oracle-apex-offical
---- docker-compose.yml
---- variables
---- conn_string.txt
CONN_STRING=sys/PASSWORDHERE@database:1521/XEPDB1
Note: The conn_string.txt file will be deleted when the container starts. The database connection details are not held in environment variables in the container.
services:
auto-xe-reg:
container_name: auto-xe-reg
image: container-registry.oracle.com/database/express:latest
ports:
- 1521:1521
environment:
- ORACLE_PWD=PLACEPASSWORDHERE
volumes:
- db-vol-reg:/opt/oracle/oradata
hostname: database
auto-ords-reg:
container_name: auto-ords-reg
restart: always
depends_on:
- auto-xe-reg
volumes:
- ./variables:/opt/oracle/variables
- ords-config-reg:/etc/ords/config
ports:
- 8181:8181
image: container-registry.oracle.com/database/ords:latest
volumes:
db-vol-reg:
name: db-vol-reg
external: false
ords-config-reg:
name: ords-config-reg
Step 4: In CMD, navigate to the folder with the updated "docker-compose.yml" file (note replace path with your path)
cd/
cd C:\Users\FIRSTNAME.LASTNAME\Desktop\esd-oracle-apex-docker-stack\oracle-apex-offical
docker compose up
docker exec -it auto-xe-reg sqlplus / as sysdba
docker exec -it auto-xe-reg sqlplus sys/<your_password>@XE as sysdba
docker exec -it auto-xe-reg sqlplus system/<your_password>@XE
docker exec -it auto-xe-reg sqlplus pdbadmin/<your_password>@XEPDB1
sqlplus sys/<your password>@//localhost:1521/XE as sysdba
Reuse Existing Database or Mount Database & ORDS containers to host directory folders for database/file persistence
In the "docker-compose.yml" file, replace volumes with a directory path.
repalce:
volumes:
- db-vol-reg:/opt/oracle/oradata
with
volumes:
- <writable_directory_path>:/opt/oracle/oradata
example:
volumes:
- C:\Oracle\opt\oracle\oradata:/opt/oracle/oradata
For ords 22.2 java ords.war deprecated
- https://www.oracle.com/tools/ords/ords-relnotes-222.html
- https://oracle-base.com/articles/misc/oracle-rest-data-services-ords-standalone-mode-22-onward
View current commands:
- ords config info
Examples:
- ords config set jdbc.MinLimit 5
- ords config set jdbc.MaxLimit 30
- ords config set jdbc.InitialLimit 15
- ords config set jdbc.MaxStatementsLimit 20
- ords config set jdbc.InactivityTimeout 3600
- ords config set jdbc.statementTimeout 1800
- ords config set jdbc.MaxConnectionReuseCount 2000
Alt Install (1): Use Community Docker Images, by using the "oracle-apex-community" directory of files with the same steps as above
Various versions and options available. I would recommended to use the latest version(regular) if seeking a balance of image size and features. Slim version is not compatiable with Oracle Apex.
Requires downloading and staging the software. Coming soon!
Docker:
- Platform for creating and running containers
Docker Compose File:
- tool for deining and running multi-container docker stack/apps
- get app running in one command
- Can be used in a Continuous Integration and Continuous Deployment (CI/CD) Pipeline
Docker file(can be used or ran via command line)
- Build instructions for an image
Docker image
- Made with build command
- Read only
- Source code. Template with all files needed to make container
Docker container:
- Made with run command
- read-write
- An instance of an image.
- Can have multiple containers to one image.
- Can be saved as a new image like a snapshot
Docker volume
- Storage for persistent data generated by docker container
- Other option is to mount to filesystem directly
\\wsl$
docker save -o C:\temp\docker_oracle\ords\ords.tar container-registry.oracle.com/database/ords
docker save -o C:\temp\xe-image\xe.tar container-registry.oracle.com/database/express:latest
docker export -o C:\temp\docker_oracle\xe_database_container\xecontainer.tar testapex
docker stop $CONTAINER
docker commit $CONTAINER $CONTAINER
docker save -o $CONTAINER.tar $CONTAINER
docker-volumes.sh $CONTAINER save $CONTAINER-volumes.tar
scp $CONTAINER.tar $CONTAINER-volumes.tar $USER@$HOST:
docker load -i $CONTAINER.tar
docker create --name $CONTAINER [<PREVIOUS CONTAINER OPTIONS>] $CONTAINER
docker-volumes.sh $CONTAINER load $CONTAINER-volumes.tar
docker start $CONTAINER
docker pull registry
docker run -d -p 5000:5000 --restart=always --name registry registry
docker login container-registry.oracle.com
docker pull container-registry.oracle.com/database/express:latest
docker pull container-registry.oracle.com/database/ords:latest
docker image tag container-registry.oracle.com/database/express localhost:5000/xe-21-3
docker image tag container-registry.oracle.com/database/ords localhost:5000/ords-apex-22
docker push localhost:5000/xe-21-3
docker push localhost:5000/ords-apex-22
docker image remove container-registry.oracle.com/database/express:latest
docker image remove container-registry.oracle.com/database/ords:latest
docker image remove localhost:5000/xe-21-3
docker image remove localhost:5000/ords-apex-22
docker pull localhost:5000/xe-21-3
docker pull localhost:5000/ords-apex-22
To bash into a running container, type this:
docker exec -t -i container_name /bin/bash
or
docker exec -ti container_name /bin/bash
or
docker exec -ti container_name sh
or just /bin/bash
sudo apt update
ls usr/lib
# ls usr/lib/oracle/21