In this session, Blaine Carter will explain how to use Docker to create Docker Containers which can be used to develop Database Applications with Node.js and Oracle REST Data Services (ORDS). He will demonstrate how to use Docker to create one container running an Oracle XE Database, a second running REST ORDS, and a third running Node.js on Linux running code from files in a directory on the host machine. All three containers will communicate through a Docker Network. Once the containers are up and running, Blaine will run through a couple of examples using the new Docker Containers.
7. Clone the RepoClone the Repo
OracleDatabase/SingleInstance/dockerfiles/buildDockerImage.sh
OracleRestDataServices/dockerfiles/buildDockerImage.sh
h ps://github.com/oracle/docker-images
13. Create and run the container
docker run -d
--name oracleXe
--network=XeOrdsNodeNet
-p 1521:1521
-p 5500:5500
-e ORACLE_PWD="Password1_good"
oracle/database:18.4.0-xe
14. Check the container status
Check the logs
docker ps
CONTAINER ID IMAGE STATUS Names
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 32 seconds (health: starting) oracleXe
STATUS
Up 5 minutes (healthy)
docker logs oracleXe
20. Create and Run the Container
docker run
--name NodeApp
--network=XeOrdsNodeNet
-e NODE_ORACLEDB_USER=rest_demo
-e NODE_ORACLEDB_PASSWORD=Tester1_test
-e NODE_ORACLEDB_CONNECTIONSTRING=oracleXe:1521/xepdb1
-p 3000:3000
oracle/nodeapp:1.0.0
docker start -i NodeApp
21. Check the container status
docker ps
CONTAINER ID IMAGE STATUS Names
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 15 minutes (healthy) oracleXe
22. Check the container status
Check the logs
docker ps -a
CONTAINER ID IMAGE STATUS Names
2674cdde34f1 oracle/nodeapp:1.0.0 Exited (0) 30 seconds ago NodeApp
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 15 minutes (healthy) oracleXe
docker logs NodeApp --timestamps
23. Docker stepsDocker steps
(Java and ORDS)(Java and ORDS)
Java container
cd docker-images/OracleJava/java-8
docker build -t oracle/serverjre:8 .
24.
25. Build the Oracle REST Data Services Docker Image
cd docker-images/OracleRestDataServices/dockerfiles
docker build --force-rm=true
--no-cache=true
-t oracle/restdataservices:19.2.0
-f Dockerfile .
26. Create and Run the Container
docker run -d
--name ORDS
--network=XeOrdsNodeNet
-e ORACLE_HOST=oracleXe
-e ORACLE_SERVICE=xepdb1
-e ORACLE_PWD="Password1_good"
-e ORDS_PWD="Tester1_test"
-p 8080:8888
oracle/restdataservices:19.2.0
27. Check the container status
Check the logs
docker ps
CONTAINER ID IMAGE STATUS Names
193204a1dcdc oracle/restdataservices:19.2.0 Up 5 seconds ORDS
aaa4cee2f6d9 oracle/database:18.4.0-xe Up 20 minutes (healthy) oracleXe
docker logs ORDS --follow --timestamps
29. Auto RESTAuto REST
Auto REST Table
un-REST Table
Auto REST View
Generate a PL/SQL API for the table
Auto REST PL/SQL API
Modify PL/SQL
30. REST enable your databaseREST enable your database
SQL DeveloperSQL Developer
SecureSecure
Create Role
Define Privilege
Privilege Mapping
OAuth 2 Client
Generate token using client credentials
Access the service
31. REST enable your databaseREST enable your database
SQL DeveloperSQL Developer
REST WIZARDREST WIZARD
Create a REST Service
POST (Upload) Image
View an Image
32. If I've done everything correctlyIf I've done everything correctly
33. ResourcesResources
ORDS Documentation -
Twi er
Blaine Carter - @OraBlaineOS
Jeff Smith - @thatjeffsmith
Kris Rice - @krisrice
Image Upload Tutorial -
h p://bit.ly/ORDS-Docs
h ps://www.thatjeffsmith.com/oracle-rest-data-services-ords/
h ps://LearnCodeShare.net
h p://bit.ly/ORDS-Image-Tutorial
34. Howdy, I’m Blaine CarterHowdy, I’m Blaine Carter
Oracle Corporation
Developer Advocate for Open Source
Email: blaine.carter@oracle.com
Blog: learncodeshare.net
Twi er: @OraBlaineOS
YouTube: www.youtube.com/blainecarter
Team: community.oracle.com/docs/DOC-
917690