Skip to content

Commit

Permalink
Releasing oracle 23.3 free dockerfiles (#2712)
Browse files Browse the repository at this point in the history
* updated 23.2 dockerfiles to 23.3 with multistage

* Added oracle 23.3 free rpm download link

* Using install instead of localinstall
  • Loading branch information
aditya059 authored Oct 10, 2023
1 parent c796f96 commit b13849a
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 24 deletions.
6 changes: 3 additions & 3 deletions OracleDatabase/SingleInstance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Sample container build files to facilitate installation, configuration, and envi

This project offers sample Dockerfiles for:

* Oracle Database 23c (23.2.0) Free
* Oracle Database 23c (23.3.0) Free
* Oracle Database 21c (21.3.0) Enterprise Edition, Standard Edition 2 and Express Edition (XE)
* Oracle Database 19c (19.3.0) Enterprise Edition and Standard Edition 2
* Oracle Database 18c (18.4.0) Express Edition (XE)
Expand Down Expand Up @@ -63,7 +63,7 @@ Before you build the image make sure that you have provided the installation bin

Parameters:
-v: version to build
Choose one of: 11.2.0.2 12.1.0.2 12.2.0.1 18.3.0 18.4.0 19.3.0 21.3.0 23.2.0
Choose one of: 11.2.0.2 12.1.0.2 12.2.0.1 18.3.0 18.4.0 19.3.0 21.3.0 23.3.0
-t: image_name:tag for the generated docker image
-e: creates image based on 'Enterprise Edition'
-s: creates image based on 'Standard Edition 2'
Expand Down Expand Up @@ -327,7 +327,7 @@ To run your Oracle Database 23c FREE container image use the `docker run` comman
-e ORACLE_PWD=<your database passwords> \
-e ORACLE_CHARACTERSET=<your character set> \
-v [<host mount point>:]/opt/oracle/oradata \
oracle/database:23.2.0-free
oracle/database:23.3.0-free

Parameters:
--name: The name of the container (default: auto generated)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@
# HOW TO BUILD THIS IMAGE
# -----------------------
# Run:
# $ podman build -t oracle/database:23.2.0-free -f Containerfile.free .
# $ podman build -t oracle/database:23.3.0-free -f Containerfile.free .
#
#
# Pull base image
# ---------------
FROM oraclelinux:8
FROM oraclelinux:8 as base

# Labels
# ------
LABEL "provider"="Oracle" \
"issues"="https://github.com/oracle/docker-images/issues" \
"volume.data"="/opt/oracle/oradata" \
"volume.setup.location1"="/opt/oracle/scripts/setup" \
"volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \
"volume.startup.location1"="/opt/oracle/scripts/startup" \
"volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \
"port.listener"="1521"
"issues"="https://github.com/oracle/docker-images/issues" \
"volume.data"="/opt/oracle/oradata" \
"volume.setup.location1"="/opt/oracle/scripts/setup" \
"volume.setup.location2"="/docker-entrypoint-initdb.d/setup" \
"volume.startup.location1"="/opt/oracle/scripts/startup" \
"volume.startup.location2"="/docker-entrypoint-initdb.d/startup" \
"port.listener"="1521"

ARG INSTALL_FILE_1="https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23c-1.0-1.el8.x86_64.rpm"

Expand Down Expand Up @@ -67,27 +67,52 @@ RUN mkdir -p "$ORACLE_BASE" && \
chmod ug+x *.sh && \
sync && \
./"$CHECK_SPACE_FILE" && \
yum -y install expect && \
./"$SETUP_LINUX_FILE" && \
chown -R oracle:oinstall "$ORACLE_BASE" /home/oracle && \
sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su && \
unbuffer yum -y install "$INSTALL_FILE_1" && \
yum -y remove expect && \
rm -rf /var/cache/yum && \
rm -rf /var/tmp/yum-* && \
mv "$CONF_FILE" /etc/sysconfig/ && \
cd "$HOME" && \
rm -rf "$INSTALL_DIR" && \
"$ORACLE_BASE"/oraInventory/orainstRoot.sh && \
"$ORACLE_HOME"/root.sh && \
rm -rf "$INSTALL_DIR"


#############################################
# -------------------------------------------
# Start new stage for installing the database
# -------------------------------------------
#############################################

FROM base AS builder

# Install DB software binaries
RUN yum -y install expect && \
unbuffer yum -y install "$INSTALL_FILE_1"


#############################################
# -------------------------------------------
# Start new layer for database runtime
# -------------------------------------------
#############################################

FROM base

USER oracle
COPY --chown=oracle:oinstall --from=builder $ORACLE_BASE $ORACLE_BASE
COPY --chown=oracle:oinstall --from=builder /etc/oratab /etc/oratab
COPY --from=builder /etc/init.d/oracle-free-23c /etc/init.d/oracle-free-23c
COPY --from=builder /usr/share/doc/oracle-free-23c/LICENSE /usr/share/doc/oracle-free-23c/LICENSE

USER root
# To enforce ORACLE_SID as FREE, adding it to .bashrc
RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \
$ORACLE_HOME/root.sh && \
echo 'export ORACLE_SID=FREE' >> /home/oracle/.bashrc && \
chown oracle.oinstall /home/oracle/.bashrc

USER oracle
WORKDIR /home/oracle

HEALTHCHECK --interval=1m --start-period=5m --timeout=30s \
CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1
CMD "$ORACLE_BASE/$CHECK_DB_FILE" >/dev/null || exit 1

EXPOSE 1521/tcp

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
#

# CONF_FILE env var is set only for XE Database
# CONF_FILE env var is set only for FREE Database
if [ "${ORACLE_SID}" = "FREE" ]; then
REQUIRED_SPACE_GB=13
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ cd "${VERSION}" || {
}

# Which Dockerfile should be used?
if [ "${VERSION}" == "12.1.0.2" ] || [ "${VERSION}" == "11.2.0.2" ] || [ "${VERSION}" == "18.4.0" ] || [ "${VERSION}" == "23.2.0" ] || { [ "${VERSION}" == "21.3.0" ] && [ "${EDITION}" == "xe" ]; }; then
if [ "${VERSION}" == "12.1.0.2" ] || [ "${VERSION}" == "11.2.0.2" ] || [ "${VERSION}" == "18.4.0" ] || [ "${VERSION}" == "23.3.0" ] || { [ "${VERSION}" == "21.3.0" ] && [ "${EDITION}" == "xe" ]; }; then
DOCKERFILE=$( if [[ -f "Containerfile.${EDITION}" ]]; then echo "Containerfile.${EDITION}"; else echo "${DOCKERFILE}.${EDITION}";fi )
fi;

Expand Down

0 comments on commit b13849a

Please sign in to comment.