Install Oracle Client 11g R2 x86 in windows container

If you put -nowait then it means that docker will skip this line and go to next one since it does not know that it was completed. You probably shall remove that line at the minimum.
If I were you I would switch to powershell and CMD processor and use similar construct to below to launch installation executable

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Continue'; $verbosePreference='Continue';"]

Start-Process -filepath "<your exe>" -ArgumentList "<your arguments>" -PassThru | Wait-Process

Thanks artisticcheese, I think you are on to something. My problem now is that I am trying to specify an argument for the oracle install for a response file and it doesnt like it…

its like this and I have got this too work outside of the docker file: SYSTEM_DRIVE:\setup.exe_location> setup [-silent] “variable=setting” [-nowelcome] [-noconfig] [-nowait] -responseFile filename

Well remember inside docker file you run it via powershell prompt, so try the correct syntax inside powershell processor via Start-Process instead of cmd.exe

Could you please post the Dockerfile if you got it to work? Thanks!

I have been struggling with this for a couple of days

Oracle setup installer and response files ready, I run the setup command with my response file on my own PC from an elevated cmd window and Oracle is installed, no problems found and oracledb installs according to my reponsefile

CMD command
setup -silent -responsefile d:\temp\database\response\db.rsp -skipPrereqs -noconfig -waitForCompletion

But even with silent switch the Oracle Universal Installer and some configuration still popup, that will not work when installing from an image or within a container itself
(see picture attached)

When try to replicate using my dockerfile or an error or nothing happens

Docker file
#Sample Dockerfile

#Indicates that the windowsservercore image will be used as the base image.
FROM microsoft/windowsservercore

#Create the working folder
RUN mkdir c:\temp\database

#Copy Oracle installers and response file to the working directory previously created
COPY database /temp/database

#Run the command
RUN Powershell.exe Start-Process -FilePath ‘C:\temp\database\setup.exe’ -argumentlist ‘-responsefile c:\temp\database\response\db.rsp’, ‘silent’ -wait

Once ready I run on an elevated powershell Window

PS D:\docker\dockerfiles> docker image build -t 2016oracle -f dockerfile .

As I said even that the build might finish successfully and without errors the application it is not installed or the container run for a moment and then exits few seconds later

I have a very similar problem installing Oracle SQLPlus and VS Redistributable on a container on MS Server 2016. Looks like it is a dead end for those who are trying to (a) Get a reasonable installation of any non-Microsoft software installed on the container (b) Run/Switch-to Linux containers on Windows 2016.

I don’t see how this shall be called a fault of windows containers where it’s issue with installation for Oracle client which can not be run in silent mode.

Hi artisticchese,

That it is not entirely true, you can create an answer file and start a total silent install, is well documented in Oracle and I managed to start the install on the container, but fails after few seconds with access denied, even that the
account is created on my docker file and member of the local admin group

It’ is something of the Windows Core image and its structure

What account was created and where is log showing access denied? I read thread again and don’t see any mentions of additional accounts and access denied error messages.

I have not updated the thread because basically I gave up with the test.

I will try to upload my new docker file and the logs, including the latest install command which avoid Oracle Universal Installer showing

But as I said still not working

Did you manage to solved it? I´m also trying to install the oracle client using the mcr.microsoft.com/windows/servercore/iis image.

I managed to dockerise the Oracle Client on Windows containers by using the following Dockerfile

FROM mcr.microsoft.com/windows/servercore:ltsc2019

SHELL ["PowerShell", "-Command"]

WORKDIR c:/oracle/setup

COPY setup/ODAC112030_x64.zip .

RUN Expand-Archive ODAC112030_x64.zip -DestinationPath ODAC112030_x64; \
	Remove-Item -Force ODAC112030_x64.zip;

COPY setup/responsefile.rsp .

RUN Start-Process c:\oracle\setup\ODAC112030_x64\setup.exe \
	-ArgumentList '-silent', '-nowait', '-waitforcompletion', '-responseFile', 'c:\oracle\setup\responsefile.rsp' \
	-NoNewWindow -Wait

COPY setup/tnsnames.ora C:/oracle/

RUN setx /M TNS_ADMIN 'C:/oracle'

What you need

  • ODAC112030_x64.zip - Oracle Client installation file
  • responsefile.rsp - response file for silent Oracle Client installation
  • tnsnames.ora - your tnsnames.ora configuration file

How to test it

  • PowerShell command: (New-Object system.data.oledb.oledbenumerator).GetElements() | where SOURCES_NAME -EQ "OraOLEDB.Oracle"
  • PowerShell script:
$conn = New-Object System.Data.OleDb.OleDbConnection
$conn.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=YOURDB;Persist Security Info=True;User ID=xxx;Password=yyy;Unicode=True"
$conn.Open()
echo $conn.GetSchema("Tables").Rows[0]
$conn.Close()
  • SQLPlus sqlplus xxx/yyy@YOURDB

Hi Peter
is this docker file working perfectly

For anyone looking for how to get an Oracle client running in a Docker Windows container, I can confirm the approach proposed here works. I used both instantclient_19_17 and instantclient_18_5 and both worked for me.

Hi,

can you please share the line of codes you follow the oracle client in windows docker container.
i am facing a problem while creating oracle instance .

Hi, the code is here GitHub - Sublime1/Oracle-Database-on-Windows-Container

Hi ,

This is Oracle Database installation in windows container. I am asking Oracle Client Installations on windows container .

Hi,

this is the file for oracle client installation on windows docker container.

FROM Microsoft Artifact Registry

SHELL [“powershell”, “-Command”]

Create a directory to copy files

RUN mkdir C:\app

COPY WINDOWS.X64_193000_client_home.zip C:/app/
COPY openjdk-11.0.2_windows-x64_bin.zip C:/app/

RUN Expand-Archive -Path C:\app\WINDOWS.X64_193000_client_home.zip -DestinationPath C:\app\WINDOWS.X64_193000_client_home;
Expand-Archive -Path C:\app\openjdk-11.0.2_windows-x64_bin.zip -DestinationPath C:\java

COPY tnsnames.ora C:/app/WINDOWS.X64_193000_client_home/network/admin/

ENV TNS_ADMIN=C:/app/WINDOWS.X64_193000_client_home/network/admin
ENV JAVA_HOME=C:/java/jdk-11.0.2
ENV ORACLE_HOME=C:/app/WINDOWS.X64_193000_client_home

RUN $newPath = $env:PATH + ‘;’ + $env:JAVA_HOME + ‘/bin;’ + $env:ORACLE_HOME + ‘/bin’;
[System.Environment]::SetEnvironmentVariable(‘PATH’, $newPath, [System.EnvironmentVariableTarget]::Machine)

Hi,

this is the Oracle client Dockerfile (untested as I had to remove some client specific stuff)

# Base Windows image - we use Servercore as Nanocore is missing critical components
FROM mcr.microsoft.com/windows/servercore:ltsc2019

# We use Powershell as our shell, and stop if any error encountered
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Oracle settings - 21c is not recommended, so we use 19c - note this contains both Basic and SQL*Plus packages downloaded from https://www.oracle.com/database/technologies/instant-client/winx64-64-downloads.html
# note that we can't download directly from Oracle's site as they don't maintain the older versions when they release updates, so we manually copy in the files ourselves
ARG ORACLE_CLIENT=instantclient_19_18 
ARG BASIC_ZIP=instantclient-basic-windows.x64-19.18.0.0.0dbru.zip 
ARG SQLPLUS_ZIP=instantclient-sqlplus-windows.x64-19.18.0.0.0dbru.zip 

ARG ORACLE_BASE=C:/apps/oracle/
ARG ORACLE_HOME=${ORACLE_BASE}${ORACLE_CLIENT}

# Create our OS environment variables
ENV ORACLE_BASE=${ORACLE_BASE} ORACLE_HOME=${ORACLE_HOME} BASIC_ZIP=${BASIC_ZIP} SQLPLUS_ZIP=${SQLPLUS_ZIP} NLS_LANG="ENGLISH_IRELAND.UTF8" NLS_DATE_FORMAT="YYYY-MM-DD"

# install Oracle client and add ORACLE_HOME to our path
COPY ${BASIC_ZIP} .
COPY ${SQLPLUS_ZIP} .
RUN $env:PATH = '{0};{1}' -f $env:PATH,$env:ORACLE_HOME ; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)  ; \ 
    Expand-Archive -Path $env:BASIC_ZIP -DestinationPath $env:ORACLE_BASE ; \
    Expand-Archive -Path $env:SQLPLUS_ZIP -DestinationPath $env:ORACLE_BASE ; \
    Remove-Item $env:BASIC_ZIP -Force ; \
    Remove-Item $env:SQLPLUS_ZIP -Force

EXPOSE 1521
CMD echo "This is the Oracle client - you should probably replace this line"
 
1 Like