This image is based on Alpine tomcat image (tomcat:9-alpine), which is only a 75MB image, and provides a docker image for Oracle REST Data Services.
- If you want to build this image, you will need to download Oracle REST Data Services 18.1.1.95.1251 and Oracle SQLcl 18.1.1.
This image is intended to be a base image for your projects, so you may use it like this:
FROM cosmomill/alpine-ords-apex
$ docker build -t my_app . --build-arg ORDS_FILE="ords.18.1.1.95.1251.zip" --build-arg SQLCL_FILE="sqlcl-18.1.1.zip"
$ docker run -d -P --link <your cosmomill/alpine-oracle-xe container>:db --volumes-from <your cosmomill/alpine-oracle-xe container> -v ords_config:/opt -e DATABASE_HOSTNAME="db" -p 8080:8080 my_app
The default list of ENV variables is:
DATABASE_HOSTNAME=
ORACLE_SID=XE
DATABASE_PORT=1521
Auto generated passwords are stored in separate hidden files in /u01/app/oracle/oradata/dbconfig/XE
with the naming system .username.passwd
.
If you want bootstrap the entire application with a single command using Docker Compose you have to use wait-for-oracle.sh
. The problem is that Docker Compose does not wait for the Oracle Database container to become ready before starting the ORDS container. When you start the application using docker-compose up
Docker Compose does not ensure that the Oracle Database container is ready before the ORDS Container is started. This means your application will fail to start. The depends_on
only means that the Oracle Database container should be started first but Docker Compose does not ensure Oracle Database is full ready for connections.
Usage example:
ords:
depends_on:
- oradb
entrypoint: /usr/local/bin/wait-for-oracle.sh -- docker-entrypoint.sh
command: run
build:
context: ./ords
ports:
- "8080:8080"
volumes:
- ords_config:/opt
volumes_from:
- oradb
environment:
DATABASE_HOSTNAME: oradb
restart: always