Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions OracleDatabase/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Copyright (c) 1982 - 2016, Oracle Corporation. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3 changes: 3 additions & 0 deletions OracleDatabase/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Unless otherwise noted, all files in this folder are released
under the Common Development and Distribution License (CDDL) 1.0
and GNU Public License 2.0 licenses.
69 changes: 69 additions & 0 deletions OracleDatabase/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Oracle Database on Docker
===============
Sample Docker build files to facilitate installation, configuration, and environment setup for DevOps users. For more information about Oracle Database please see the [Oracle Database Online Documentation](http://docs.oracle.com/database/121/index.htm).

## How to build and run
This project offers sample Dockerfiles for both Oracle Database 12c (12.1.0.2) Enterprise Edition and Standard Edition. To assist in building the images, you can use the [buildDockerImage.sh](dockerfiles/buildDockerImage.sh) script. See below for instructions and usage.

The `buildDockerImage.sh` script is just a utility shell script that performs MD5 checks and is an easy way for beginners to get started. Expert users are welcome to directly call `docker build` with their prefered set of parameters.

### Building Oracle Database Docker Install Images
**IMPORTANT:** You will have to provide the installation binaries of Oracle Database and put them into the `dockerfiles/<version>` folder. You only need to provide the binaries for the edition you are going to install.

Before you build the image make sure that you have provided the installation binaries and put them into the right folder. Once you have chosen which edition and version you want to build an image of, go into the **dockerfiles** folder and run the **buildDockerImage.sh** script as root or with `sudo` privileges:

[oracle@localhost dockerfiles]$ ./buildDockerImage.sh -h

Usage: buildDockerImage.sh -v [version] [-e | -s | -x] [-p] [-i]
Builds a Docker Image for Oracle Database.

Parameters:
-v: version to build
Choose one of: 11.2.0.2 12.1.0.2
-e: creates image based on 'Enterprise Edition'
-s: creates image based on 'Standard Edition 2'
-x: creates image based on 'Express Edition'
-p: password for database admin accounts (it will be generated if omitted)
-i: ignores the MD5 checksums

* select one edition only: -e, -s, or -x

LICENSE CDDL 1.0 + GPL 2.0

Copyright (c) 2014-2016 Oracle and/or its affiliates. All rights reserved.

**IMPORTANT:** The resulting images will be an newly installed Oracle Database. You may extend the image with your own Dockerfile and create the users and tablespaces that you may need.

### Running Oracle Database in a Docker container
To run your Oracle Database Docker image just use the **docker run** command as follows:

docker run -p 1521:1521 -p 5500:5500 oracle/database:12.1.0.2-ee

There are two ports that are exposed in this image:
* 1521 which is the port to connect to the Oracle Database.
* 5500 which is the port of Oracle Enterprise Manager Express.

The admin accounts created are:
* system (SYSDBA for ORCLCDB)
* pdbadmin (ORCLPDB1)

Once the container has been started you can connect to it just like to any other database:

sqlplus system/<your password>@//localhost:1521/ORCLCDB
sqlplus pdbadmin/<your password>@//localhost:1521/ORCLPDB1

You may use the same Docker image to run `sqlplus`, for example:

docker run --rm -ti oracle/database:12.1.0.2-ee sqlplus pdbadmin/<yourpassword>@//<db-container-ip>:1521/ORCLPDB1

The Oracle Database inside the container also has Oracle Enterprise Manager Express configured. To access OEM Express, start your browser and follow the URL:

https://localhost:5500/em/

## License
To download and run Oracle Database, regardless whether inside or outside a Docker container, you must download the binaries from the Oracle website and accept the license indicated at that page.

All scripts and files hosted in this project and GitHub [docker-images/OracleDatabase](./) repository required to build the Docker images are, unless otherwise noted, released under the Common Development and Distribution License (CDDL) 1.0 and GNU Public License 2.0 licenses.

## Copyright
Copyright (c) 2014-2016 Oracle and/or its affiliates. All rights reserved.
5 changes: 5 additions & 0 deletions OracleDatabase/dockerfiles/11.2.0.2/Checksum.xe
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Download Oracle Database 11g Release 2 (11.2.0.1.0) Express Edition for Linux x86-64
#
# - http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
#
dd7881a55569d890241f11cd0eeb7d48 oracle-xe-11.2.0-1.0.x86_64.rpm.zip
91 changes: 91 additions & 0 deletions OracleDatabase/dockerfiles/11.2.0.2/Dockerfile.xe
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# LICENSE CDDL 1.0 + GPL 2.0
#
# Copyright (c) 1982-2016 Oracle and/or its affiliates. All rights reserved.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Dockerfile for Oracle Database 11g Release 2 Express Edition
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# (1) oracle-xe-11.2.0-1.0.x86_64.rpm.zip
# Download Oracle Database 11g Release 2 Express Edition for Linux x64
# from http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Put the downloaded file in the same directory as this Dockerfile
# Run:
# $ docker build -t oracle/database:11.2.0.2-xe .
#
# IMPORTANT
# ---------
# Oracle XE requires Docker 1.10.0 and above:
# Oracle XE uses shared memory for MEMORY_TARGET and needs at least 2 GB.
# Docker only supports --shm-size since Docker 1.10.0
#
# Pull base image
# ---------------
FROM oraclelinux:latest

# Maintainer
# ----------
MAINTAINER Gerald Venzl <gerald.venzl@oracle.com>

# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
ENV ORACLE_BASE=/u01/app/oracle \
ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe/ \
ORACLE_SID=XE \
INSTALL_FILE_1="oracle-xe-11.2.0-1.0.x86_64.rpm.zip" \
INSTALL_DIR="$PWD/install" \
CONFIG_RSP="xe.rsp"
# Use second ENV so that variable get substituted
ENV PATH=$ORACLE_HOME/bin:$PATH

# Copy binaries
# -------------
COPY $INSTALL_FILE_1 $INSTALL_DIR/
COPY $CONFIG_RSP $INSTALL_DIR/

# Update yum
# ----------
RUN yum -y install unzip libaio bc initscripts net-tools && \
yum clean all

WORKDIR $INSTALL_DIR

# Install Oracle Express Edition
# ------------------------------
RUN unzip $INSTALL_FILE_1 && \
rm $INSTALL_FILE_1 && \
rpm -i Disk1/*.rpm && \
/etc/init.d/oracle-xe configure responseFile=$CONFIG_RSP && \
cat $ORACLE_HOME/network/admin/listener.ora

# Listener
RUN echo "LISTENER = \
(DESCRIPTION_LIST = \
(DESCRIPTION = \
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE)) \
(ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) \
) \
) \
\
" > $ORACLE_HOME/network/admin/listener.ora

RUN echo "DEDICATED_THROUGH_BROKER_LISTENER=ON" >> $ORACLE_HOME/network/admin/listener.ora
RUN echo "DEFAULT_SERVICE_LISTENER = ($ORACLE_SID) \
\
" >> $ORACLE_HOME/network/admin/listener.ora
RUN echo "DIAG_ADR_ENABLED = off" >> $ORACLE_HOME/network/admin/listener.ora;

RUN /etc/init.d/oracle-xe start && \
echo "EXEC DBMS_XDB.SETLISTENERLOCALACCESS(FALSE);" | sqlplus SYSTEM/oracle@//localhost:1521/XE

WORKDIR $HOME
RUN rm -rf $INSTALL_DIR
EXPOSE 1521
EXPOSE 8080

CMD ["/etc/init.d/oracle-xe", "start"]
44 changes: 44 additions & 0 deletions OracleDatabase/dockerfiles/11.2.0.2/xe.rsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
###############################################################################
# #
# HTTP port that will be used to access APEX admin page #
# Default : 8080 #
# #
###############################################################################
ORACLE_HTTP_PORT=8080

###############################################################################
# #
# TNS port that will be used to configure listener #
# Default : 1521 #
# #
###############################################################################
ORACLE_LISTENER_PORT=1521

###############################################################################
# #
# Passwords can be supplied for the following two schemas in the #
# starter database: #
# SYS #
# SYSTEM #
# #
###############################################################################
ORACLE_PASSWORD=oracle

###############################################################################
# #
# Passwords can be supplied for the following two schemas in the #
# starter database: #
# SYS #
# SYSTEM #
# #
# ORACLE_CONFIRM_PASSWORD should be same as ORACLE_PASSWORD #
# #
###############################################################################
ORACLE_CONFIRM_PASSWORD=oracle

###############################################################################
# #
# To start/stop listener and database instance up on system boot #
# #
###############################################################################
ORACLE_DBENABLE=y
10 changes: 10 additions & 0 deletions OracleDatabase/dockerfiles/12.1.0.2/Checksum.ee
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Download Oracle Database 12c Release 1 (12.1.0.2.0) Enterprise Edition for Linux x86-64 File 1
#
# - http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
#
080435a40bd4c8dff6399b231a808e9a linuxamd64_12102_database_1of2.zip
# Download Oracle Database 12c Release 1 (12.1.0.2.0) Enterprise Edition for Linux x86-64 File 2
#
# - http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
#
30f20ef9437442b8282ce3984546c982 linuxamd64_12102_database_2of2.zip
10 changes: 10 additions & 0 deletions OracleDatabase/dockerfiles/12.1.0.2/Checksum.se2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Download Oracle Database 12c Release 1 (12.1.0.2.0) Standard Edition 2 for Linux x86-64 File 1
#
# - http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
#
dadbf2cfbc9b53f92d0b07f6677af966 linuxamd64_12102_database_se2_1of2.zip
# Download Oracle Database 12c Release 1 (12.1.0.2.0) Standard Edition 2 for Linux x86-64 File 2
#
# - http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
#
2bda8cd4883bbd3f892dc152e568fc9e linuxamd64_12102_database_se2_2of2.zip
Loading