oracle / docker-images

Official source of container configurations, images, and examples for Oracle products and projects
https://developer.oracle.com/use-cases/#containers
Universal Permissive License v1.0
6.54k stars 5.42k forks source link

Getting an Error message while creating a oracle db image on WSL distro ubuntu #2380

Closed altaf369us closed 2 years ago

altaf369us commented 2 years ago

Am i doing something wrong here.

sudo ./buildContainerImage.sh -v 18.4.0 -x Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. Checking Podman version. Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. Ignored MD5 checksum.

Container runtime info: Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. host: arch: amd64 buildahVersion: 1.23.1 cgroupControllers:

========================== Building image 'oracle/database:18.4.0-xe' ... Emulate Docker CLI using podman. Create /etc/containers/nodocker to quiet msg. STEP 1/8: FROM oraclelinux:7-slim STEP 2/8: 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" "port.oemexpress"="5500" "port.apex"="8080" --> ad8f7bb39b6 STEP 3/8: ENV ORACLE_BASE=/opt/oracle ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE ORACLE_SID=XE INSTALL_FILE_1="https://download.oracle.com/otn-pub/otn_software/db-express/oracle-database-xe-18c-1.0-1.x86_64.rpm" RUN_FILE="runOracle.sh" PWD_FILE="setPassword.sh" CONF_FILE="oracle-xe-18c.conf" CHECK_SPACE_FILE="checkSpace.sh" CHECK_DB_FILE="checkDBStatus.sh" INSTALL_DIR="$HOME/install" ORACLE_DOCKER_INSTALL="true" --> dca2812d99b STEP 4/8: ENV PATH=$ORACLE_HOME/bin:$PATH --> 9772817bfa5 STEP 5/8: COPY $CHECK_SPACE_FILE $RUN_FILE $PWD_FILE $CHECK_DB_FILE $CONF_FILE $INSTALL_DIR/ --> e90e39561ba STEP 6/8: RUN chmod ug+x $INSTALL_DIR/.sh && sync && $INSTALL_DIR/$CHECK_SPACE_FILE && cd $INSTALL_DIR && yum -y install expect openssl oracle-database-preinstall-18c && sed -i -e 's/(oracle\s+hard\s+nofile)/# \1/' /etc/security/limits.d/oracle-database-preinstall-18c.conf && unbuffer yum -y install $INSTALL_FILE_1 && yum -y remove expect && rm -rf /var/cache/yum && rm -rf /var/tmp/yum- && mkdir -p $ORACLE_BASE/scripts/setup && mkdir $ORACLE_BASE/scripts/startup && ln -s $ORACLE_BASE/scripts /docker-entrypoint-initdb.d && mkdir -p $ORACLE_BASE/oradata /home/oracle && chown -R oracle:oinstall $ORACLE_BASE /home/oracle && mv $INSTALL_DIR/$RUN_FILE $ORACLE_BASE/ && mv $INSTALL_DIR/$PWD_FILE $ORACLE_BASE/ && mv $INSTALL_DIR/$CHECK_DB_FILE $ORACLE_BASE/ && mv $INSTALL_DIR/$CONF_FILE /etc/sysconfig/ && ln -s $ORACLE_BASE/$PWD_FILE / && cd $HOME && rm -rf $INSTALL_DIR && chmod ug+x $ORACLE_BASE/.sh WARN[0000] pkg/bind: error removing "/var/tmp/buildah4005439925/mnt": directory not empty ERRO[0000] directory not empty error running container: error bind mounting root filesystem from "/var/lib/containers/storage/overlay/dbeeb6e9836b25b3891cb820d6eae8da8dfea05d14b62d41852b0594951c71aa/merged" to "/var/tmp/buildah4005439925/mnt/rootfs": invalid argument Error: error building at STEP "RUN chmod ug+x $INSTALL_DIR/.sh && sync && $INSTALL_DIR/$CHECK_SPACE_FILE && cd $INSTALL_DIR && yum -y install expect openssl oracle-database-preinstall-18c && sed -i -e 's/(oracle\s+hard\s+nofile)/# \1/' /etc/security/limits.d/oracle-database-preinstall-18c.conf && unbuffer yum -y install $INSTALL_FILE_1 && yum -y remove expect && rm -rf /var/cache/yum && rm -rf /var/tmp/yum- && mkdir -p $ORACLE_BASE/scripts/setup && mkdir $ORACLE_BASE/scripts/startup && ln -s $ORACLE_BASE/scripts /docker-entrypoint-initdb.d && mkdir -p $ORACLE_BASE/oradata /home/oracle && chown -R oracle:oinstall $ORACLE_BASE /home/oracle && mv $INSTALL_DIR/$RUN_FILE $ORACLE_BASE/ && mv $INSTALL_DIR/$PWD_FILE $ORACLE_BASE/ && mv $INSTALL_DIR/$CHECK_DB_FILE $ORACLE_BASE/ && mv $INSTALL_DIR/$CONF_FILE /etc/sysconfig/ && ln -s $ORACLE_BASE/$PWD_FILE / && cd $HOME && rm -rf $INSTALL_DIR && chmod ug+x $ORACLE_BASE/.sh": error while running runtime: exit status 1

ERROR: Oracle Database container image was NOT successfully created. ERROR: Check the output and correct any reported problems with the build operation.

yunus-qureshi commented 2 years ago

21.3 XE is also available. Do try that. Also, have you set the required env vars required for podman build

https://github.com/oracle/docker-images/blob/main/OracleDatabase/SingleInstance/README.md#building-the-container-images-using-podman

altaf369us commented 2 years ago

Yes i have, Following is the error i'm getting it now.

Capture2

altaf369us commented 2 years ago

I have tried with the 21.3 XE, following is the error i'm getting.

Capture3

yunus-qureshi commented 2 years ago

If you need express edition, pass -x instead of -e

altaf369us commented 2 years ago

forgot to add the SCs, i have tried it with -x, no luck. please find the screen shots. also tried with 18 and 21 XE, getting same error. Capture5 Capture6 Capture7 Capture4

yunus-qureshi commented 2 years ago

Have you tried after setting the BUILDAH envs as documented https://github.com/oracle/docker-images/blob/main/OracleDatabase/SingleInstance/README.md#building-the-container-images-using-podman

altaf369us commented 2 years ago

Literally these are the below steps i have tried so far. wont passed after step 8.

Ubuntu for Windows (WSL)

  1. cd /mnt/c/Users/myuser/
  2. mkdir oracle
  3. cd oracle
  4. git clone https://github.com/oracle/docker-images.git
  5. cd OracleDatabase/SingleInstance/dockerfiles
  6. export BUILDAH_FORMAT=docker
  7. export BUILDAH_ISOLATION=chroot
  8. sudo ./buildContainerImage.sh -v 18.4.0 -x (without sudo failed during package installation)
altaf369us commented 2 years ago

i'm using ubuntu version 22.04 LTS on windows.

yunus-qureshi commented 2 years ago

Don't use sudo in step 8. Try rootless podman

altaf369us commented 2 years ago

seems to be working. have passed that stage where i was getting an error. will share the update. currently installing. pls find SCs below.

Capture

altaf369us commented 2 years ago

Capture1

Its just hang there.

yunus-qureshi commented 2 years ago

May be some resource crunch. Have you allocated enough disk space for Ubuntu/WSL

altaf369us commented 2 years ago

Capture2

yunus-qureshi commented 2 years ago

It doesn't tell me how much free disk space is available. Also did you try 21.3 XE?

altaf369us commented 2 years ago

I have tried it, it just hang there. please find the free disk info here.

Capture1 Capture2

altaf369us commented 2 years ago

I'am able to build oracle xe 18.4.0 database image inside the container. However, I like to know does oracle have The Oracle XE Database 18c server Docker image that contains a pre-built database? like this one https://container-registry.oracle.com/ords/f?p=113:4:115087109343200:::4:P4_REPOSITORY,AI_REPOSITORY,AI_REPOSITORY_NAME,P4_REPOSITORY_NAME,P4_EULA_ID,P4_BUSINESS_AREA_ID:803,803,Oracle%20Database%20Express%20Edition,Oracle%20Database%20Express%20Edition,1,0&cs=36bdIC2zPi95OaD0_Z9htSDJqSOC3ffVUnH3H1Jrg4xnsSOYnaoRFe6zQg0Ahmjccgdsm1o412kzJyaz191UOow

abhisbyk commented 2 years ago

@altaf369us Oracle does not have 18.4 XE image with pre-built database. Oracle database 21.3 XE has a pre-built database and is also available on the container registry.

altaf369us commented 2 years ago

@abhisbyk, Ok thx much

yunus-qureshi commented 2 years ago

@altaf369us is the 21.3 XE image from container-registry working for you?

docker pull container-registry.oracle.com/database/express:latest

altaf369us commented 2 years ago

I have built 18.4.0 XE image container. Now, I would like to know how would i connect to it? is this the suername SYS, SYSTEM and PDBADMIN to connect to Oracle DB? Basically, I just need an assistance in connecting to the DB.

altaf369us commented 2 years ago

oracle db Oradba xe Oradbcontainer

abhisbyk commented 2 years ago

To connect with the database, you can use sqlplus. Here, SYS, SYSADMIN and PDBADMIN are users to the DB. Sample commands for database version 18.3 XE are as follows:

sqlplus sys/<your-db-password>@//localhost:1521/XE as sysdba
sqlplus system/<your-db-password>@//localhost:1521/XE
sqlplus pdbadmin/<your-db-password>@//localhost:1521/XEPDB1