1

I'm trying to install Oracle XE 18c in a docker container in Windows 10. I have docker already installed, and I need to build the image as explained here.

I cloned the git repository, but I'm stuck on this step, as what I cloned are Linux commands and not Windows.

After cloning with:

git clone https://github.com/oracle/docker-images.git

If I cd to docker-images\OracleDatabase\SingleInstance\dockerfiles\18.4.0 to build the image I see the following sh comands, instead of exe or bat:

12/28/2019  01:36 PM             1,137 checkDBStatus.sh
12/28/2019  01:36 PM               905 checkSpace.sh
12/28/2019  01:36 PM                75 Checksum.xe
12/28/2019  01:36 PM             2,752 Dockerfile.xe
12/28/2019  01:36 PM               533 oracle-xe-18c.conf
12/28/2019  01:36 PM             6,132 runOracle.sh
12/28/2019  01:36 PM               775 setPassword.sh

How to build this image in Windows?

  • What's your Docker environment?. Docker Desktop or Docker Toolbox? – Kumar Dec 28 '19 at 21:15
2

Use Wsl Ubuntu Bash set path to Docker executables or simply install Git Bash for Windows from Docker Tools and run the shell script from Git Bash terminal(I prefer Git Bash).Download and Copy Oracle18xe rpm file to 18.40 folder

This is output from Git Bash for windows

 xxx@localhost MINGW64 /d/docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0 (master)                                                                                                                                                                                              
    $ ls -lrt
    total 2513906
    -rw-r--r-- 1 user 197121         74 Dec 28 13:17 Checksum.xe
    -rw-r--r-- 1 user 197121       2675 Dec 28 13:17 Dockerfile.xe
    -rwxr-xr-x 1 user 197121       1137 Dec 28 13:17 checkDBStatus.sh*
    -rwxr-xr-x 1 user 197121        905 Dec 28 13:17 checkSpace.sh*
    -rw-r--r-- 1 user 197121        533 Dec 28 13:17 oracle-xe-18c.conf
    -rwxr-xr-x 1 user 197121       6132 Dec 28 13:17 runOracle.sh*
    -rwxr-xr-x 1 user 197121        775 Dec 28 13:17 setPassword.sh*
    -rw-r--r-- 1 user 197121 2574155124 Dec 28 13:48 oracle-database-xe-18c-1.0-1.x86_64.rpm

After running shell script successfully

xxx@localhost MINGW64 /d/docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0 (master)
$ docker image ls
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
oracle/database     18.4.0-xe           19b38be42ae6        30 minutes ago      8.44GB
oraclelinux         7-slim              0d49b70bc432        9 days ago          118MB

xxx@localhost MINGW64 /d/docker-images/OracleDatabase/SingleInstance/dockerfiles (master)
$ docker run --name myxedb \
>     -d \
>     -p 51521:1521 \
>     -p 55500:5500 \
>     -e ORACLE_PWD=xxxxxxx \
>     -e ORACLE_CHARACTERSET=AL32UTF8 \
>     oracle/database:18.4.0-xe


xxx@localhost MINGW64 /d/docker-images/OracleDatabase/SingleInstance/dockerfiles/18.4.0 (master)
$ docker ps
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS                             PORTS                                                        NAMES
afce013adb98        oracle/database:18.4.0-xe   "/bin/sh -c 'exec $O…"   19 seconds ago      Up 16 seconds (health: starting)   8080/tcp, 0.0.0.0:51521->1521/tcp, 0.0.0.0:55500->5500/tcp   myxedb

You can connect to database via sqlplus or login into docker container using Windows Dos

    D:\>docker exec -it --user=oracle myxedb bash


[oracle@afce013adb98 /]$ . oraenv
ORACLE_SID = [XE] ?
The Oracle base remains unchanged with value /opt/oracle



[oracle@afce013adb98 /]$ sqlplus / as sysdba

    SQL*Plus: Release 18.0.0.0.0 - Production on Sun Dec 29 05:04:32 2019
    Version 18.4.0.0.0

    Copyright (c) 1982, 2018, Oracle.  All rights reserved.


    Connected to:
    Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
    Version 18.4.0.0.0

    SQL> select banner from v$version;

    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production

P.S:-Make sure you logged into docker hub from git bash terminal docker login

  • Thanks for posting your answer. I downloaded the rpm, checked the sha-256 and put it in 18.4.0 directory, but when running the shell script I get md5sum: 'oracle-database-xe-18c-1.0-1.x86_64.rpm'$'\r': No such file or directory. The file name is correct, what's wrong? – ps0604 Dec 29 '19 at 15:21
  • Yes that's correct one.Are you running the command ./buildDockerImage.sh -v 18.4.0 -x (it should be x at the end for Express edition).Work around is comment out validate packages in shell script. – Kumar Dec 29 '19 at 17:21
  • adding -i to ignore the check sum worked – ps0604 Dec 29 '19 at 18:10
  • Yes I realized that after posting that comment :-) – Kumar Dec 29 '19 at 19:04
  • can you take a look at this? thanks – ps0604 Feb 17 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.