Skip to content

Commit c3d719d

Browse files
committed
pick latest on patch RAC container
1 parent d336354 commit c3d719d

File tree

4 files changed

+55
-13
lines changed

4 files changed

+55
-13
lines changed

OracleDatabase/RAC/OracleRealApplicationClusters/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -248,15 +248,16 @@ Refer to [README](./docs/CLEANUP.md) for instructions on how to connect to an Or
248248

249249
## Sample Container Files for Older Releases
250250

251-
This project offers example container files for Oracle Grid Infrastructure and Oracle Real Application Clusters for dev and test:
251+
This project offers example container (Podman) files for Oracle Grid Infrastructure and Oracle Real Application Clusters for dev and test:
252252

253-
* Oracle Database 18c Oracle Grid Infrastructure (18.3) for Linux x86-64
254-
* Oracle Database 18c (18.3) for Linux x86-64
255-
* Oracle Database 12c Release 2 Oracle Grid Infrastructure (12.2.0.1.0) for Linux x86-64
256-
* Oracle Database 12c Release 2 (12.2.0.1.0) Enterprise Edition for Linux x86-64
253+
* Oracle Database 21c Oracle Grid Infrastructure (21.3) for Linux x86-64
254+
* Oracle Database 21c (21.3) for Linux x86-64
255+
* Oracle Database 19c Oracle Grid Infrastructure (19.3) for Linux x86-64
256+
* Oracle Database 19c (19.3) for Linux x86-64
257257

258-
To install older releases of Oracle RAC on Podman or Oracle RAC on Docker, refer to the [README.md](./docs/README_1.md)
258+
To install older releases of Oracle RAC on Docker, refer to the [README.md](./docs/README_1.md#section-4-oracle-rac-on-docker)
259259

260+
**Note** For RAC on Podman, do not refer older release details. Refer this project instructions for latest on RAC on Podman.
260261
## Support
261262

262263
At the time of this release, Oracle RAC on Podman is supported for Oracle Linux 8.10 or later. To see the current Linux support certifications, refer to [Oracle RAC on Podman Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/21/install-and-upgrade.html)

OracleDatabase/RAC/OracleRealApplicationClusters/samples/applypatch/buildPatchedContainerImage.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,18 @@ echo "Building image '$IMAGE_NAME' ..."
9999

100100
# BUILD THE IMAGE (replace all environment variables)
101101
BUILD_START=$(date '+%s')
102-
docker build --force-rm=true --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t $IMAGE_NAME -f Dockerfile . || {
102+
docker build --no-cache=true $DOCKEROPS $PROXY_SETTINGS -t env -f ContainerfileEnv .
103+
104+
docker cp $(docker create --name env --rm env):/tmp/.env ./
105+
106+
docker build --no-cache=true $DOCKEROPS \
107+
--build-arg GRID_HOME=$(grep GRID_HOME .env | cut -d '=' -f2) \
108+
--build-arg DB_HOME=$(grep DB_HOME .env | cut -d '=' -f2) $PROXY_SETTINGS -t $IMAGE_NAME -f Containerfile . || {
103109
echo "There was an error building the image."
104110
exit 1
105111
}
112+
docker rmi -f env
113+
106114
BUILD_END=$(date '+%s')
107115
BUILD_ELAPSED=`expr $BUILD_END - $BUILD_START`
108116

OracleDatabase/RAC/OracleRealApplicationClusters/samples/applypatch/latest/Dockerfile renamed to OracleDatabase/RAC/OracleRealApplicationClusters/samples/applypatch/latest/Containerfile

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ ARG RAC_SLIM_IMAGE=localhost/oracle/database-rac:19.3.0-slim
2121

2222
# Pull base image
2323
# ---------------
24-
# hadolint ignore=DL3006
2524
FROM $BASE_RAC_IMAGE as builder
2625

2726
# Argument to control removal of components not needed after db software installation
@@ -65,17 +64,40 @@ RUN chown -R grid:oinstall $PATCH_INSTALL_DIR/*.sh && \
6564
USER oracle
6665

6766
RUN $PATCH_INSTALL_DIR/$DB_PATCH_FILE $PATCH_INSTALL_DIR
68-
# hadolint ignore=DL3002
67+
6968
USER root
7069

7170
RUN $PATCH_INSTALL_DIR/$FIXUP_PREQ_FILE && \
7271
rm -rf /etc/oracle && \
7372
rm -rf $PATCH_INSTALL_DIR
7473

7574
#####################
76-
# hadolint ignore=DL3006
7775
FROM $RAC_SLIM_IMAGE AS final
7876

77+
# Define build-time arguments
78+
ARG GRID_HOME
79+
ARG DB_HOME
80+
81+
#Set environment variables using build arguments
82+
ENV GRID_BASE=/u01/app/grid \
83+
GRID_HOME=$GRID_HOME \
84+
DB_BASE=/u01/app/oracle \
85+
DB_HOME=$DB_HOME \
86+
INSTALL_SCRIPTS=/opt/scripts/install \
87+
SCRIPT_DIR=/opt/scripts/startup \
88+
RAC_SCRIPTS_DIR="scripts"
89+
90+
ENV GRID_PATH=$GRID_HOME/bin:$GRID_HOME/OPatch/:$GRID_HOME/perl/bin:/usr/sbin:/bin:/sbin \
91+
DB_PATH=$DB_HOME/bin:$DB_HOME/OPatch/:$DB_HOME/perl/bin:/usr/sbin:/bin:/sbin \
92+
GRID_LD_LIBRARY_PATH=$GRID_HOME/lib:/usr/lib:/lib \
93+
DB_LD_LIBRARY_PATH=$DB_HOME/lib:/usr/lib:/lib
94+
95+
# Run some basic command to verify the environment variables (optional)
96+
RUN echo "GRID_BASE=$GRID_BASE" && \
97+
echo "GRID_HOME=$GRID_HOME" && \
98+
echo "DB_BASE=$DB_BASE" && \
99+
echo "DB_HOME=$DB_HOME"
100+
79101
RUN if [ -d "/u01" ]; then \
80102
rm -rf /u01 && \
81103
:; \
@@ -89,7 +111,9 @@ WORKDIR $WORKDIR
89111

90112
HEALTHCHECK --interval=2m --start-period=30m \
91113
CMD "$SCRIPT_DIR/scripts/main.py --checkracinst=true" >/dev/null || exit 1
92-
114+
#Fix SID detection
115+
RUN $INVENTORY/orainstRoot.sh && \
116+
$GRID_HOME/root.sh && \
117+
$DB_HOME/root.sh
93118
# Define default command to start Oracle Grid and RAC Database setup.
94-
# hadolint ignore=DL3025
95-
ENTRYPOINT /usr/bin/$INITSH
119+
ENTRYPOINT /usr/bin/$INITSH
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Stage 1: Base Stage with Environment Variables
2+
ARG BASE_RAC_IMAGE=localhost/oracle/database-rac:19.3.0
3+
FROM $BASE_RAC_IMAGE
4+
5+
# Write the environment variables to a .env file
6+
RUN echo "GRID_HOME=$GRID_HOME" >> /tmp/.env && \
7+
echo "DB_HOME=$DB_HOME" >> /tmp/.env
8+
9+
ENTRYPOINT ["/bin/bash"]

0 commit comments

Comments
 (0)