Oracle 23.3.0 FREE build docker image error for yum install
basilzuberi opened this issue · comments
Hi.
While using the ./buildContainerImage.sh
script to create a docker image for the 23.3.0 FREE oracle db, I have encountered the following issue while the Docker Build is going on. I have replicated this issue locally and on a Jenkins automation for building these images.
the build command executed is: ./buildContainerImage.sh -v 23.3.0 -f -t path/to/repo/oracle:fe-23.3.0
the error stated is:
ERROR: failed to solve: process "/bin/sh -c yum -y install expect && unbuffer yum -y install \"$INSTALL_FILE_1\"" did not complete successfully: exit code: 1
ERROR: Oracle Database container image was NOT successfully created.
ERROR: Check the output and correct any reported problems with the build operation.
where INSTALL_FILE_1 = https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23c-1.0-1.el8.x86_64.rpm
The logs are as follows:
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
Checking Docker version.
Containerfile.free
Ignored MD5 checksum.
==========================
Container runtime info:
Client: Docker Engine - Community
Version: 25.0.3
Context: default
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: v0.12.1
Path: /usr/libexec/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.24.5
Path: /usr/libexec/docker/cli-plugins/docker-compose
Server:
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 20
Server Version: 25.0.3
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: false
Native Overlay Diff: true
userxattr: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc version: v1.1.12-0-g51d5e94
init version: de40ad0
Security Options:
seccomp
Profile: builtin
Kernel Version: 5.15.146.1-microsoft-standard-WSL2
Operating System: Ubuntu 22.04.4 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 15.47GiB
Name: ABC
ID: XYZ
Docker Root Dir: /var/lib/docker
Debug Mode: false
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
==========================
Building image 'path/to/repo/oracle:fe-23.3.0' ...
[+] Building 421.8s (9/15) docker:default
=> [internal] load build definition from Containerfile.free 0.1s
=> => transferring dockerfile: 4.20kB 0.0s
=> [internal] load metadata for docker.io/library/oraclelinux:8 1.2s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 37.00kB 0.0s
=> [base 1/4] FROM docker.io/library/oraclelinux:8@sha256:8c3d188f53441f457c631df5c7714d139c51d77e9f53eba59416e34bb3cb3638 21.6s
=> => resolve docker.io/library/oraclelinux:8@sha256:8c3d188f53441f457c631df5c7714d139c51d77e9f53eba59416e34bb3cb3638 0.0s
=> => sha256:2c2be9dbf3fbcc2fd00c1a899133096fbac0992fc75622b99eb6fb89678b5c50 100.80MB / 100.80MB 11.1s
=> => sha256:8c3d188f53441f457c631df5c7714d139c51d77e9f53eba59416e34bb3cb3638 547B / 547B 0.0s
=> => sha256:a2e98216db6349568578019d876bfc30fbeafce0e21bc3a1edbae522b6247ecc 530B / 530B 0.0s
=> => sha256:1e96959d807ae8d62a7ef227881efec7ee8d3409eb54c8edf53479d1d07c26fe 1.48kB / 1.48kB 0.0s
=> => extracting sha256:2c2be9dbf3fbcc2fd00c1a899133096fbac0992fc75622b99eb6fb89678b5c50 10.1s
=> [base 2/4] COPY checkSpace.sh oracle-free-23c.conf setupLinuxEnv.sh runOracle.sh setPassword.sh checkDBStatus.sh createDB.sh runUserScripts.sh configTcps.sh /install/ 0.5s
=> [base 3/4] WORKDIR /install 0.1s
=> [base 4/4] RUN mkdir -p "/opt/oracle" && mv "runOracle.sh" "setPassword.sh" "checkDBStatus.sh" "createDB.sh" "runUserScripts.sh" "configTcps.sh" "/opt/oracle"/ && chmo 210.7s
=> ERROR [builder 1/1] RUN yum -y install expect && unbuffer yum -y install "https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23c-1.0-1.el8.x86_6 187.4s
------
> [builder 1/1] RUN yum -y install expect && unbuffer yum -y install "https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23c-1.0-1.el8.x86_64.rpm":
2.929 Last metadata expiration check: 0:02:11 ago on Fri May 3 15:14:39 2024.
6.099 Dependencies resolved.
6.103 ================================================================================
6.103 Package Architecture Version Repository Size
6.103 ================================================================================
6.103 Installing:
6.103 expect x86_64 5.45.4-5.el8 ol8_baseos_latest 266 k
6.103 Installing dependencies:
6.103 tcl x86_64 1:8.6.8-2.el8 ol8_baseos_latest 1.1 M
6.103
6.103 Transaction Summary
6.103 ================================================================================
6.103 Install 2 Packages
6.103
6.104 Total download size: 1.4 M
6.105 Installed size: 4.7 M
6.105 Downloading Packages:
6.741 (1/2): expect-5.45.4-5.el8.x86_64.rpm 421 kB/s | 266 kB 00:00
6.806 (2/2): tcl-8.6.8-2.el8.x86_64.rpm 1.6 MB/s | 1.1 MB 00:00
6.809 --------------------------------------------------------------------------------
6.810 Total 1.9 MB/s | 1.4 MB 00:00
6.854 Running transaction check
6.867 Transaction check succeeded.
6.867 Running transaction test
6.936 Transaction test succeeded.
6.938 Running transaction
7.301 Preparing : 1/1
7.701 Installing : tcl-1:8.6.8-2.el8.x86_64 1/2
7.776 Running scriptlet: tcl-1:8.6.8-2.el8.x86_64 1/2
7.856 Installing : expect-5.45.4-5.el8.x86_64 2/2
7.897 Running scriptlet: expect-5.45.4-5.el8.x86_64 2/2
7.987 Verifying : expect-5.45.4-5.el8.x86_64 1/2
7.987 Verifying : tcl-1:8.6.8-2.el8.x86_64 2/2
8.361
8.361 Installed:
8.361 expect-5.45.4-5.el8.x86_64 tcl-1:8.6.8-2.el8.x86_64
8.361
8.361 Complete!
9.974 Last metadata expiration check: 0:02:18 ago on Fri May 3 15:14:39 2024.
oracle-database-free-23c-1.0-1.el8.x86_64.rpm 9.7 MB/s | 1.6 GB 02:53 -- ETA
186.9 Error:
186.9 Problem: package oracle-database-free-23c-1.0-1.x86_64 from @commandline requires oracle-database-preinstall-23c, but none of the providers can be installed
186.9 - package oracle-database-preinstall-23ai-1.0-2.el8.x86_64 from ol8_appstream obsoletes oracle-database-preinstall-23c provided by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 from ol8_developer
186.9 - package oracle-database-preinstall-23ai-1.0-2.el8.x86_64 from ol8_appstream obsoletes oracle-database-preinstall-23c provided by oracle-database-preinstall-23c-1.0-1.el8.x86_64 from ol8_developer
186.9 - problem with installed package oracle-database-preinstall-23ai-1.0-2.el8.x86_64
186.9 - installed package oracle-database-preinstall-23ai-1.0-2.el8.x86_64 obsoletes oracle-database-preinstall-23c provided by oracle-database-preinstall-23c-1.0-0.5.el8.x86_64 from ol8_developer
186.9 - installed package oracle-database-preinstall-23ai-1.0-2.el8.x86_64 obsoletes oracle-database-preinstall-23c provided by oracle-database-preinstall-23c-1.0-1.el8.x86_64 from ol8_developer
186.9 - conflicting requests
186.9 (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
------
Containerfile.free:86
--------------------
85 | # Install DB software binaries
86 | >>> RUN yum -y install expect && \
87 | >>> unbuffer yum -y install "$INSTALL_FILE_1"
88 |
--------------------
ERROR: failed to solve: process "/bin/sh -c yum -y install expect && unbuffer yum -y install \"$INSTALL_FILE_1\"" did not complete successfully: exit code: 1
ERROR: Oracle Database container image was NOT successfully created.
ERROR: Check the output and correct any reported problems with the build operation.
Please let me know what we can do to fix this issue if it is on our side,
thank you.
It also reproduces locally without specifying -f -t path/to/repo/oracle:fe-23.3.0
option.
git clone https://github.com/oracle/docker-images/
cd docker-images/OracleDatabase/SingleInstance/dockerfiles/
./buildContainerImage.sh -v 23.3.0 -f
If you are looking for 23ai Free release then you may download the prebuilt image
container-registry.oracle.com/database/free:23.4.0.0
The current 23.3 scripts will not work with 23ai Free release. We are working on replacing the scripts.
Thanks @yunus-qureshi,
We also attempted to build and run other images, namely 21.3.0 Enterprise Edition, and load DB scripts after the init stages... but we get the following error, and have no idea why.
if you want me to create a separate ticket let me know, but we are not even able to get past the initial stages of the database... it seems like the control01.ctl file does not exist in the docker image, neither does any reference to spfile's or pfile's...
ORACLE EDITION: ENTERPRISE
LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 04-MAY-2024 02:36:31
Copyright (c) 1991, 2021, Oracle. All rights reserved.
Starting /opt/oracle/product/21c/dbhome_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 21.0.0.0.0 - Production
System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
Log messages written to /opt/oracle/diag/tnslsnr/oracle-db-0/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production
Start Date 04-MAY-2024 02:36:31
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/oracle-db-0/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
The listener supports no services
The command completed successfully
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
8% complete
Copying database files
/opt/oracle/createDB.sh: line 318: 49 Killed dbca -silent -createDatabase -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" ${DBCA_CRED_OPTIONS} -responseFile "$ORACLE_BASE"/dbca.rsp
[ 2024-05-04 02:36:40.409 UTC ] [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
[ 2024-05-04 02:36:40.409 UTC ] [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
[ 2024-05-04 02:36:40.409 UTC ] [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards.
[ 2024-05-04 02:36:45.539 UTC ] Prepare for db operation
DBCA_PROGRESS : 8%
[ 2024-05-04 02:36:45.691 UTC ] Copying database files
SQL*Plus: Release 21.0.0.0.0 - Production on Sat May 4 02:36:59 2024
Version 21.3.0.0.0
Copyright (c) 1982, 2021, Oracle. All rights reserved.
Connected to:
Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
SQL> ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' scope=spfile
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE is in use
SQL>
System altered.
SQL> ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE
*
ERROR at line 1:
ORA-01109: database not open
SQL> BEGIN DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE); END;
*
ERROR at line 1:
ORA-06550: line 1, column 7:
PLS-00201: identifier 'DBMS_XDB_CONFIG.SETGLOBALPORTENABLED' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
SQL> SQL>
Session altered.
SQL> CREATE USER OPS$oracle IDENTIFIED EXTERNALLY
*
ERROR at line 1:
ORA-01109: database not open
SQL> GRANT CREATE SESSION TO OPS$oracle
*
ERROR at line 1:
ORA-01109: database not open
SQL> GRANT SELECT ON sys.v_$pdbs TO OPS$oracle
*
ERROR at line 1:
ORA-01109: database not open
SQL> GRANT SELECT ON sys.v_$database TO OPS$oracle
*
ERROR at line 1:
ORA-01109: database not open
SQL> ALTER USER OPS$oracle SET container_data=all for sys.v_$pdbs container = current
*
ERROR at line 1:
ORA-01109: database not open
SQL> SQL> Disconnected from Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production
Version 21.3.0.0.0
The Oracle base remains unchanged with value /opt/oracle
mv: cannot stat '/opt/oracle/dbs/spfileORCLCDB.ora': No such file or directory
Executing user defined scripts
/opt/oracle/runUserScripts.sh: running /opt/oracle/scripts/setup/00-allow-connections.sql
ALTER SYSTEM SET LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521))' SCOPE=BOTH
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE is in use
System altered.
ERROR:
ORA-65011: Pluggable database ORCLPDB1 does not exist.
ALTER SYSTEM SET LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521))' SCOPE=BOTH
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE is in use
System altered.
DONE: Executing user defined scripts
The Oracle base remains unchanged with value /opt/oracle
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################
The following output is now a tail of the alert.log:
Successful mount of redo thread 1, with mount id 201811718
2024-05-04T02:36:54.995688+00:00
Database mounted in Exclusive Mode
Lost write protection disabled
Create Relation IPS_PACKAGE_UNPACK_HISTORY
Completed: ALTER DATABASE MOUNT
2024-05-04T02:36:57.644566+00:00
Using default pga_aggregate_limit of 3840 MB
2024-05-04T02:36:59.266337+00:00
ALTER SYSTEM SET local_listener='' SCOPE=MEMORY;
2024-05-04T02:37:49.413501+00:00
Full restore complete of datafile 1 to datafile copy /opt/oracle/oradata/ORCLCDB/system01.dbf. Elapsed time: 0:00:50
checkpoint is 2601842
last deallocation scn is 2595942
Undo Optimization current scn is 1130003
2024-05-04T02:38:13.741108+00:00
Full restore complete of datafile 3 to datafile copy /opt/oracle/oradata/ORCLCDB/sysaux01.dbf. Elapsed time: 0:00:19
checkpoint is 2601842
last deallocation scn is 2600878
2024-05-04T02:38:20.396184+00:00
Full restore complete of datafile 4 to datafile copy /opt/oracle/oradata/ORCLCDB/undotbs01.dbf. Elapsed time: 0:00:01
checkpoint is 2601842
last deallocation scn is 3
2024-05-04T02:38:21.447710+00:00
Full restore complete of datafile 7 to datafile copy /opt/oracle/oradata/ORCLCDB/users01.dbf. Elapsed time: 0:00:00
checkpoint is 2601842
last deallocation scn is 3
2024-05-04T02:38:22.380279+00:00
Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc:
ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/system01.dbf
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
2024-05-04T02:38:22.387176+00:00
Switch of datafile 1 complete to datafile copy
checkpoint is 2601842
2024-05-04T02:38:22.395536+00:00
Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc:
ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/sysaux01.dbf
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Switch of datafile 3 complete to datafile copy
checkpoint is 2601842
2024-05-04T02:38:22.409588+00:00
Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc:
ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/undotbs01.dbf
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Switch of datafile 4 complete to datafile copy
checkpoint is 2601842
2024-05-04T02:38:22.426242+00:00
Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc:
ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/users01.dbf
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
Switch of datafile 7 complete to datafile copy
checkpoint is 2601842
Collapse
I have modified the original Containerfile.free in the 23.3.0/
, and I can successfully build the image. @yunus-qureshi
Three RMP files need to be downloaded in advance and placed in the 23.3.0/
.
you can use my version of Containerfile.free:
# LICENSE UPL 1.0
#
# Copyright (c) 2022-2023 Oracle and/or its affiliates.
#
# ORACLE DOCKERFILES PROJECT
# --------------------------
# This is the Contatinerfile for Oracle Database 23c Free
#
# REQUIRED FILES TO BUILD THIS IMAGE
# ----------------------------------
# None
#
# HOW TO BUILD THIS IMAGE
# -----------------------
# Run:
# $ podman build -t oracle/database:23.3.0-free -f Containerfile.free .
#
#
# Pull base image
# ---------------
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"
# Environment variables required for this build (do NOT change)
# -------------------------------------------------------------
# INSTALL_FILE_1:
# https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23ai-1.0-1.el8.x86_64.rpm
# DEV_FILE_1:
# https://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64/getPackage/oraclelinux-developer-release-el8-1.0-6.el8.x86_64.rpm
# PREINSTALL_FILE_1:
# https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-23ai-1.0-2.el8.x86_64.rpm
ENV ORACLE_BASE=/opt/oracle \
ORACLE_HOME=/opt/oracle/product/23ai/dbhomeFree \
ORACLE_SID=FREE \
DEV_FILE_1="oraclelinux-developer-release-el8-1.0-6.el8.x86_64.rpm" \
INSTALL_FILE_1="oracle-database-free-23ai-1.0-1.el8.x86_64.rpm" \
PREINSTALL_FILE_1="oracle-database-preinstall-23ai-1.0-2.el8.x86_64.rpm" \
RUN_FILE="runOracle.sh" \
PWD_FILE="setPassword.sh" \
CREATE_DB_FILE="createDB.sh" \
USER_SCRIPTS_FILE="runUserScripts.sh" \
CONF_FILE="oracle-free-23c.conf" \
CHECK_SPACE_FILE="checkSpace.sh" \
CHECK_DB_FILE="checkDBStatus.sh" \
SETUP_LINUX_FILE="setupLinuxEnv.sh" \
CONFIG_TCPS_FILE="configTcps.sh" \
INSTALL_DIR="$HOME/install" \
ORACLE_DOCKER_INSTALL="true" \
CHECKPOINT_FILE_EXTN=".created"
# Use second ENV so that variable get substituted
ENV PATH=$ORACLE_HOME/bin:$PATH
# Copy binaries
# -------------
COPY $CHECK_SPACE_FILE $CONF_FILE $SETUP_LINUX_FILE $RUN_FILE $PWD_FILE $CHECK_DB_FILE $CREATE_DB_FILE $USER_SCRIPTS_FILE $CONFIG_TCPS_FILE $PREINSTALL_FILE_1 $DEV_FILE_1 $INSTALL_DIR/
WORKDIR $INSTALL_DIR
# hadolint ignore=DL3003,DL3033,SC2035
RUN mkdir -p "$ORACLE_BASE"
RUN mv "$RUN_FILE" "$PWD_FILE" "$CHECK_DB_FILE" "$CREATE_DB_FILE" "$USER_SCRIPTS_FILE" "$CONFIG_TCPS_FILE" "$ORACLE_BASE"/
RUN chmod ug+x *.sh
RUN sync
RUN ./"$CHECK_SPACE_FILE"
RUN mkdir -p "$ORACLE_BASE"/scripts/setup && \
mkdir "$ORACLE_BASE"/scripts/startup && \
mkdir -p "$ORACLE_BASE"/scripts/extensions/setup && \
mkdir "$ORACLE_BASE"/scripts/extensions/startup && \
ln -s "$ORACLE_BASE"/scripts /docker-entrypoint-initdb.d && \
mkdir -p "$ORACLE_BASE"/oradata /home/oracle && \
mkdir -p "$ORACLE_HOME" && \
chmod ug+x "$ORACLE_BASE"/*.sh
RUN dnf makecache
RUN dnf localinstall -y $INSTALL_DIR/$DEV_FILE_1
RUN dnf localinstall -y $INSTALL_DIR/$PREINSTALL_FILE_1
RUN dnf install -y openssl hostname
RUN rm -rf /var/cache/yum && \
ln -s "$ORACLE_BASE"/"$PWD_FILE" /home/oracle/ && \
echo oracle:oracle | chpasswd && \
chown -R oracle:dba "$ORACLE_BASE"
RUN if [ "${ORACLE_SID}" = "FREE" ]; then sed -ie 's/^root:\*/root:/' /etc/shadow; fi
# RUN ./"$SETUP_LINUX_FILE"
RUN chown -R oracle:oinstall "$ORACLE_BASE" /home/oracle
RUN sed -i -r 's/(^session\s+include\s+system-auth)/# \1/' /etc/pam.d/su
RUN mv "$CONF_FILE" /etc/sysconfig/
RUN rm -rf "$INSTALL_DIR"
#############################################
# -------------------------------------------
# Start new stage for installing the database
# -------------------------------------------
#############################################
FROM base AS builder
COPY $INSTALL_FILE_1 /
# Install DB software binaries
RUN yum -y install expect
RUN chmod ug+x /$INSTALL_FILE_1
RUN unbuffer yum -y localinstall /$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-23ai /etc/init.d/oracle-free-23ai
COPY --from=builder /usr/share/doc/oracle-free-23ai/LICENSE /usr/share/doc/oracle-free-23ai/LICENSE
USER root
# To enforce ORACLE_SID as FREE, adding it to .bashrc
RUN $ORACLE_BASE/oraInventory/orainstRoot.sh && \
RUN $ORACLE_HOME/root.sh && \
RUN echo 'export ORACLE_SID=FREE' >> /home/oracle/.bashrc && \
RUN 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
EXPOSE 1521/tcp
CMD [ "/bin/bash", "-c", "$ORACLE_BASE/$RUN_FILE" ]
@imitators thanks we have done something more. Expect a PR soon. cc @aditya059
Thanks @yunus-qureshi, We also attempted to build and run other images, namely 21.3.0 Enterprise Edition, and load DB scripts after the init stages... but we get the following error, and have no idea why.
if you want me to create a separate ticket let me know, but we are not even able to get past the initial stages of the database... it seems like the control01.ctl file does not exist in the docker image, neither does any reference to spfile's or pfile's...
ORACLE EDITION: ENTERPRISE LSNRCTL for Linux: Version 21.0.0.0.0 - Production on 04-MAY-2024 02:36:31 Copyright (c) 1991, 2021, Oracle. All rights reserved. Starting /opt/oracle/product/21c/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 21.0.0.0.0 - Production System parameter file is /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/oracle-db-0/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 21.0.0.0.0 - Production Start Date 04-MAY-2024 02:36:31 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/homes/OraDB21Home1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/oracle-db-0/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) The listener supports no services The command completed successfully [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. Prepare for db operation 8% complete Copying database files /opt/oracle/createDB.sh: line 318: 49 Killed dbca -silent -createDatabase -enableArchive "$ENABLE_ARCHIVELOG" -archiveLogDest "$ARCHIVELOG_DIR" ${DBCA_CRED_OPTIONS} -responseFile "$ORACLE_BASE"/dbca.rsp [ 2024-05-04 02:36:40.409 UTC ] [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards. [ 2024-05-04 02:36:40.409 UTC ] [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards. [ 2024-05-04 02:36:40.409 UTC ] [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards. [ 2024-05-04 02:36:45.539 UTC ] Prepare for db operation DBCA_PROGRESS : 8% [ 2024-05-04 02:36:45.691 UTC ] Copying database files SQL*Plus: Release 21.0.0.0.0 - Production on Sat May 4 02:36:59 2024 Version 21.3.0.0.0 Copyright (c) 1982, 2021, Oracle. All rights reserved. Connected to: Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Version 21.3.0.0.0 SQL> ALTER SYSTEM SET control_files='/opt/oracle/oradata/ORCLCDB/control01.ctl' scope=spfile * ERROR at line 1: ORA-32001: write to SPFILE requested but no SPFILE is in use SQL> System altered. SQL> ALTER PLUGGABLE DATABASE ORCLPDB1 SAVE STATE * ERROR at line 1: ORA-01109: database not open SQL> BEGIN DBMS_XDB_CONFIG.SETGLOBALPORTENABLED (TRUE); END; * ERROR at line 1: ORA-06550: line 1, column 7: PLS-00201: identifier 'DBMS_XDB_CONFIG.SETGLOBALPORTENABLED' must be declared ORA-06550: line 1, column 7: PL/SQL: Statement ignored SQL> SQL> Session altered. SQL> CREATE USER OPS$oracle IDENTIFIED EXTERNALLY * ERROR at line 1: ORA-01109: database not open SQL> GRANT CREATE SESSION TO OPS$oracle * ERROR at line 1: ORA-01109: database not open SQL> GRANT SELECT ON sys.v_$pdbs TO OPS$oracle * ERROR at line 1: ORA-01109: database not open SQL> GRANT SELECT ON sys.v_$database TO OPS$oracle * ERROR at line 1: ORA-01109: database not open SQL> ALTER USER OPS$oracle SET container_data=all for sys.v_$pdbs container = current * ERROR at line 1: ORA-01109: database not open SQL> SQL> Disconnected from Oracle Database 21c Enterprise Edition Release 21.0.0.0.0 - Production Version 21.3.0.0.0 The Oracle base remains unchanged with value /opt/oracle mv: cannot stat '/opt/oracle/dbs/spfileORCLCDB.ora': No such file or directory Executing user defined scripts /opt/oracle/runUserScripts.sh: running /opt/oracle/scripts/setup/00-allow-connections.sql ALTER SYSTEM SET LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521))' SCOPE=BOTH * ERROR at line 1: ORA-32001: write to SPFILE requested but no SPFILE is in use System altered. ERROR: ORA-65011: Pluggable database ORCLPDB1 does not exist. ALTER SYSTEM SET LOCAL_LISTENER='(ADDRESS=(PROTOCOL=TCP)(HOST=0.0.0.0)(PORT=1521))' SCOPE=BOTH * ERROR at line 1: ORA-32001: write to SPFILE requested but no SPFILE is in use System altered. DONE: Executing user defined scripts The Oracle base remains unchanged with value /opt/oracle ##################################### ########### E R R O R ############### DATABASE SETUP WAS NOT SUCCESSFUL! Please check output for further info! ########### E R R O R ############### ##################################### The following output is now a tail of the alert.log: Successful mount of redo thread 1, with mount id 201811718 2024-05-04T02:36:54.995688+00:00 Database mounted in Exclusive Mode Lost write protection disabled Create Relation IPS_PACKAGE_UNPACK_HISTORY Completed: ALTER DATABASE MOUNT 2024-05-04T02:36:57.644566+00:00 Using default pga_aggregate_limit of 3840 MB 2024-05-04T02:36:59.266337+00:00 ALTER SYSTEM SET local_listener='' SCOPE=MEMORY; 2024-05-04T02:37:49.413501+00:00 Full restore complete of datafile 1 to datafile copy /opt/oracle/oradata/ORCLCDB/system01.dbf. Elapsed time: 0:00:50 checkpoint is 2601842 last deallocation scn is 2595942 Undo Optimization current scn is 1130003 2024-05-04T02:38:13.741108+00:00 Full restore complete of datafile 3 to datafile copy /opt/oracle/oradata/ORCLCDB/sysaux01.dbf. Elapsed time: 0:00:19 checkpoint is 2601842 last deallocation scn is 2600878 2024-05-04T02:38:20.396184+00:00 Full restore complete of datafile 4 to datafile copy /opt/oracle/oradata/ORCLCDB/undotbs01.dbf. Elapsed time: 0:00:01 checkpoint is 2601842 last deallocation scn is 3 2024-05-04T02:38:21.447710+00:00 Full restore complete of datafile 7 to datafile copy /opt/oracle/oradata/ORCLCDB/users01.dbf. Elapsed time: 0:00:00 checkpoint is 2601842 last deallocation scn is 3 2024-05-04T02:38:22.380279+00:00 Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc: ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/system01.dbf ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 2024-05-04T02:38:22.387176+00:00 Switch of datafile 1 complete to datafile copy checkpoint is 2601842 2024-05-04T02:38:22.395536+00:00 Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc: ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/sysaux01.dbf ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 Switch of datafile 3 complete to datafile copy checkpoint is 2601842 2024-05-04T02:38:22.409588+00:00 Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc: ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/undotbs01.dbf ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 Switch of datafile 4 complete to datafile copy checkpoint is 2601842 2024-05-04T02:38:22.426242+00:00 Errors in file /opt/oracle/diag/rdbms/orclcdb/ORCLCDB/trace/ORCLCDB_ora_760.trc: ORA-19625: error identifying file /ade/b/3738518557/oracle/oradata/SEEDDATA/users01.dbf ORA-27037: unable to obtain file status Linux-x86_64 Error: 2: No such file or directory Additional information: 7 Switch of datafile 7 complete to datafile copy checkpoint is 2601842 Collapse
I have solved this query I also added, if you want to take a look, and maybe add a comment, it can help others as to why i may have been getting this error, @yunus-qureshi
If you are looking for 23ai Free release then you may download the prebuilt image container-registry.oracle.com/database/free:23.4.0.0
The current 23.3 scripts will not work with 23ai Free release. We are working on replacing the scripts.
Thank you. Running the following commands solved this issue:
- Pull the Oracle Database Docker image.
docker pull container-registry.oracle.com/database/free:23.4.0.0
- Run the Oracle Database Docker container.
docker run -d --name oracle_container -p 1521:1521 container-registry.oracle.com/database/free:23.4.0.0
- Set a password for the admin accounts.
docker exec oracle_container ./setPassword.sh mySecretPassword123
23.4.0 build scripts have been published.