Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Deploying an Oracle Database in a Docker Container
Sean StaceyOracle Database PMOracle Code, 2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
Docker Overview
Oracle and Docker
Deploying an Oracle Database on Docker
Docker on Oracle Cloud
Extras
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
Docker Overview
Oracle and Docker
Deploying an Oracle Database on Docker
Docker on Oracle Cloud
Extras
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• A software container platform
• Originated from Linux / Linux Containers
– Also available on Windows and Mac OS X
– Solaris is coming soon
• Part of the Linux Open Container Initiative (OCI)– Part of Open Source Linux
• Editions:
– Commercial Edition (EE) – Sold by Docker Corp
– Community Edition (CE) – Part of Open Source Linux
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• An improved, user-friendly Linux Container technology
• Easy, human readable mechanism to build containers images based on recipes, aka Dockerfiles
• Networking, memory, CPU, and file system boundaries for processes
• Images for containers can be easily shared and extended– Container file system is layered; deltas used with copy-on-write
• Extremely fast adoption by developers
• Considered as a “light-weight” virtualization technology
An Open Platform to Build, Ship, and Run Distributed Applications
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Docker
Comparing Docker against LXC and Hypervisors
Hardware Hardware Hardware Hardware
Hypervisor Operating System Operating System Operating System
HypervisorVM 0
OS
bins/libs
apps
VM 1
OS
bins/libs
apps
VM 0
OS
bins/libs
apps
VM 1
OS
bins/libs
apps
bins/libsContainer0
bins/libs
apps
Container1
apps
bins/libs
Container0
bins/libs
apps
Container1
apps
Hypervisor Type1 Hypervisor Type2 LXC Docker
CLI REST Dockerfile
volumes
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• Container: A lightweight standalone, executable piece ofsoftware that includes everything required to run it on a host
• Docker-engine: The sowftare engine running containers
• Images: Collection of software to be run as a container
• Registry: Place to store and download images
• Volumes: Place to persist data outside the container
Terminology
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Docker Key Components
Source: https://docs.docker.com/engine/docker-overview/
• Docker Client talks to Docker Daemon
• Client can run on a same machine or connect remotely
• Docker Registries or Hubs hold images
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Docker Key Components - Volumes
Source: https://docs.docker.com/engine/docker-overview/
• Docker Client talks to Docker Daemon
• Client can run on a same machine or connect remotely
• Docker Registries or Hubs hold images
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• Containers are non-persistent
– Once a container is deleted, all files inside that container are gone
• Images are immutable
– Changes to an image require a new image build
– Data to be persisted has to be stored in volumes
• Containers are spun up from images
Concepts
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
What is Docker?
• Allows abstraction of environments into images
• Allows creation of hierarchical images
• Supports multi-layered image registries
Concepts
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
DevOps and Docker…
• Abstracts virtual environment (container) creationinto simple steps:– docker create …
– docker run …
– docker rm …
• Runs directly on the Linux kernel (cgroups)– Avoids the hypervisor overhead
Why the Popularity?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
• Developers benefit:– Quickly create ready-to-run packaged
applications
– A clean, safe, hygienic, portable runtime environment
– No missing/conflicting dependencies or packages
– Each app runs in an isolated container
– Automate testing, integration, packaging
– Reduce/eliminate platform compatibility issues
– Cheap/zero cost deployment, with instant replay and reset
• Administrators benefit:
– Configure once, run many times
– Makes app lifecycle efficient, consistent and repeatable
– Eliminate environment inconsistencies between development, test, production
– Supports segregation of duties
– Improve speed and reliability of continuous integration and deployment
– Lightweight containers address performance, costs, deployment and portability issues
DevOps and Docker…Why the Popularity?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
One Application Instance Per Container
• Running multiple instances of the same application or different applications will make scheduling very difficult
• Expose very few ports per container (preferably one)
Physical Host
Operating System
Container
App
Container
App
Just One Per Container
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Containers Are The New Virtualization TrendFour main use cases
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Hardware
Operating System
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Container
App
Application Packaging
Continuous Integration DIY PaaS
Infrastructure Consolidation
Neatly package applications and supporting environment in immutable, portable containers
All changes to an app are contained in one immutable container image. Container is tested and deployed as one atomic unit
Get infrastructure utilization up to 100% (vs 5-10% with VMs) due to over-subscription of resources and near bare metal performance.
Build a simple PaaS by wiring up containers to a load balancer. New code, patches, etc pushed as new immutable containers.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Docker Overview
Oracle and Docker
Deploying an Oracle Database on Docker
Docker on Oracle Cloud
Extras
3
4
5
2
1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle joined OCI – Open Container Initiative
• Governance structure for the express purpose of creating industry standards around container formats and runtime.
• Customers can commit to container technologies w/o the worry of being locked in.
• Oracle joined in 2015.
– blogs.oracle.com/solaris/entry/oracle_joins_the_open_container
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Database on Docker
• Oracle Database is fully supported on Docker
– Oracle Linux 7.3 and later
– Red Hat Enterprise Linux 7
• Oracle Database version 12.1.0.2 or later
• Oracle images on Oracle Container Registry & Docker Store
• Docker build files on GitHub
• RAC is also supported
My Oracle Support Note – Oracle Support for Database Running on Docker (Doc ID 2216342.1) -https://support.oracle.com/epmos/faces/DocumentDisplay?id=2216342.1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Multitenant & Docker
App B App CApp A
App A App B App C
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Database on Docker
• Docker container contains single-PDB CDB
• PDB can be plugged, unplugged, etc.
• PDB can move bi-directional
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle on GitHubRecipes and samples for Docker Images of Oracle products and projects
https://github.com/oracle/docker-images
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Recipes and Samples for Docker Images
• GitHub project contains only samples and Dockerfiles (recipes) for building images
– No binaries are published.
– Customers must download binaries from Oracle as usual.
• Oracle does not provide compiled Docker images for non-Open Source, commercial products on any public registry (i.e.: Docker Hub)
• Recipes and samples for Docker images on GitHub are published under CDDL+GPL dual license
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
https://hub.docker.com/u/oracle/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Program Agenda
Docker Overview
Oracle and Docker
Deploying an Oracle Database on Docker
Docker on Oracle Cloud
Extras
2
4
5
3
1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Install Docker in your Oracle Linux 7.4 host
# cd /etc/yum.repos.d/
# wget http://yum.oracle.com/public-yum-ol7.repo
# vi public-yum-ol7.repo
>> edit entries for ol7_latest, ol7_uekr4 and ol7_addons:
>> enabled=1
# yum install docker-engine
# systemctl start docker
# systemctl enable docker
# systemctl status docker
https://blogs.oracle.com/hlsu/install-docker-on-oracle-linux-7
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Prepare the Container for deploying the Database
# yum install oracle-rdbms-server-12cR1-preinstall –y
# useradd -u 54321 -g oinstall -G dba oracle
# id oracle
# passwd oracle
# SELINUX=permissive
# reboot
# setenforce permissive
# echo "oracle ALL=(ALL) NOPASSWD: /usr/bin/docker" >> /etc/sudoers
# echo "alias docker=\"sudo /usr/bin/docker\"" >> /home/oracle/.bash_profile
# su - oracle
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Pull the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Pull the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Pull the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Pull the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Pull the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Pull the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Running the Oracle Database Image
Without mapping any ports.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Running the Oracle Database Image
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
Docker Overview
Oracle and Docker
Deploying an Oracle Database on Docker
Docker on Oracle Cloud
Extras
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
How Do You Deploy Containers?The emerging space of container orchestration
What Do Container Orchestration Solutions Do?• Map containers back to physical
hosts, taking into account user-defined placement rules, the utilization of each host, and the needs of each container. Can be very complex
• Set up overlay networking, firewalls, ensure network QoS, etc
• Auto-scaling
• Local and external load balancers
• Service registry / discovery
HostHost
HostHost
HostHost
HostHost
HostHost
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
App
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
• Inventory Microservice
• AcmeCo• v1.2
Container
App
Many Containers
HostHost
HostHost
HostHost
HostHost
HostHost
Many Hosts
Docker Swarm
Emerging space. Solutions are very early and lack any real notion of an application. Still very much infrastructure-focused
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Cloud and Docker Containers
Container CSCompute CS Application Container CS
DIY Container Management
Oracle Managed Container Orchestration
Docker-based Cloud Polyglot Platform
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
DIY
Docker on Oracle Cloud – The Big Picture
Container CS
App. Container CS
JavaNode.js
Any container workload
PHPPythonRubyC++Go
Compute Cloud Service
• Application Container Cloud Service
• Run Cloud Native applications with ease
• Container Cloud Service
• Oracle-provided container orchestration tooling
• Compute Cloud Service
• DIY Docker orchestration
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Container Cloud ServiceProvides Out of the Box Functionality
● Define Resource Pools
● Add Private Registries
● Administer Users / Groups
● Edit Create New Services
● Compose Application Stacks
● Deploy Stacks with 1 Click
● Automated Deployment
● Multi-Host, Easy Scale Out
● Built in Service Discovery
● Integrated Health Checks
● Unified Dashboard
● Monitoring and Auditing
Configuration
Management
Application
Deployment
Container
Orchestration
Operations
Management
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle Application Container Cloud Service
• Deploy Cloud Native applications with ease
• Applications run on Oracle Linux inside Docker containers– Docker image definition and container creation is abstracted from developers
• Stateless Applications– Ephemeral disk
– Permanent storage through database or storage service
• Support for patching language runtimes
An open and highly available Docker container-based elastic polyglot Cloud platform
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Docker and Oracle Cloud
• Oracle Cloud provides a large spectrum of solutions for Docker based Microservices architectures
• Three Public Cloud offerings for Docker container based deployments
–On Compute CS, with a DIY approach
– On Container CS, with an Oracle managed and supported, Cloud Native approach
– On Application Container CS, with a seamless Cloud Native application runtime approach
• Oracle Public Cloud Machine is capable of hosting container based workloads
Summary
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda
Docker Overview
Oracle and Docker
Deploying an Oracle Database on Docker
Docker on Oracle Cloud
Extras
1
2
3
4
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Links and External Resources
• Oracle Docker Container Registry– https://container-registry.oracle.com/
• Oracle Linux Docker Setup – (Oracle Linux Blog: Honglin Su)– https://blogs.oracle.com/hlsu/install-docker-on-oracle-linux-7
• Oracle on GitHub– http://www.github.com/oracle/docker-images
• Oracle DB Setup on Docker – (Oracle Blog: Gerald Venzl)– https://geraldonit.com/2017/08/21/creating-an-oracle-database-docker-image/
• Oracle on Docker Hub– http://hub.docker.com/u/oracle
• MOS Oracle DB Support Policy for Docker– https://support.oracle.com/epmos/faces/DocumentDisplay?id=2216342.1
• MOS Oracle Support Policy for Docker on Linux– https://support.oracle.com/epmos/faces/DocumentDisplay?id=1921163.1