How do I create a docker image for Oracle 18c on Windows?

I need an Oracle 18c database for integration testing on Windows (Server 2016 and Server 2019 boxes), and I’d like to have docker images for this database. My understanding is that there are no official docker images for Oracle 18c.

I’ve built an oracle 18c docker image for Linux (as explained here) and can run it on a Linux box.

I’ve pulled that image onto a Windows box configured to run Linux docker images and get the following errors:

$ docker run -p 1521:1521 -e ORACLE_SID=ORACLEDB -e ORACLE_PWD=Today1234 oracle/database:18.3.0-ee
ORACLE PASSWORD FOR SYS,SYSTEM and PDBADMIN: Today1234

LSNRCTRL for Linux: Version 18.0.0.0 - Production on 17-Sep-2020 02:19:23

Starting /opt/oracle/product/18c/dbhome_1/network/log/listener.log

TNSLSNR for Linux: Version 18.0.0.0.0 - Production
NL-00280: error creating log stream /opt/oracle/product/18c/dbhome_1/network/log/listener.log
 NL-00278: cannot open log file
  SNL-00016: snlfohd: error opening file
   Linux Error: 13: Permission denied

Listener failed to start. See the error message(s) above...

cat: /opt/oracle/cfgtoollogs/dbca/ORACLEDB/ORACLEDB.log: No such file or directory
cat: /opt/oracle/cfgtoollogs/dbca/ORACLEDB.log: No such file or directory
mv: cannot stat '/opt/oracle/product/18c/dbhome_1/dbs/spfileORACLEDB.ora': No such file or directory
mv: cannot stat '/opt/oracle/product/18c/dbhome_1/dbs/orapwORACLEDB': No such file or directory
mv: cannot stat '/opt/oracle/product/18c/dbhome_1/network/admin/tnsnames.ora': No such file or directory
ORACLE_HOME = [/home/oracle] ? ORACLE_BASE environment variable is not being set since this
information is not available for the current user ID .
You can set ORACLE_BASE manually if it is required.
Resetting ORACLE_BASE to its previous value or ORACLE_HOME
The Oracle base remains unchanged with value /opt/oracle
/opt/oracle/checkDBStatus.sh: line 26: sqlplus: command not found
#####################################
########### E R R O R ###############
DATABASE SETUP WAS NOT SUCCESSFUL!
Please check output for further info!
########### E R R O R ###############
#####################################

I’m assuming this is a user/group issue as when I log into the container on Linux I see the following:

But on Linux I see the following:

$ docker -it oracle/database:18.3.0-ee
[[email protected] ~]$ id
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba),54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54330(racdba)

But on Windows I see the following:

$ docker -it oracle/database:18.3.0-ee
bash-4.2# id
uid=0(root) gid=0(root) groups=0(root)

Question #1: Is it possible to run the Oracle database image for Linux on Windows (as I have done with the SQLServer database image for Linux on Windows) and if so, how do I fix the above error?

Question #2: If running the Oracle database image for Linux on Windows is not the correct solution, what other options are there?

Source: Docker Questions