Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle client built by Windows Docker image

Shulou Source: shulou.com Published: 2022-06-01 19:44:24 10月03日 Update

The new version of Windows 2016 already supports native Docker, and now some services will be migrated to Docker for testing.

The environment uses .net 3.5 and .net 4.0 and the Oracle client, so the Web container needs to install the Oracle client

Dockerfile

FROM microsoft/iis# install .NET 3.5ADD sxs / sxsRUN Dism / online / enable-feature / featurename:NetFX3 / All / Source:C:\ sxs / LimitAccess & & del / S / Q C:\ sxs# install ASP.NET 4.5RUN dism / online / enable-feature / all / featurename:NetFx4 / featurename:IIS-ApplicationInit / featurename:IIS-ASPNET45 / featurename:IIS-ASPNET / NoRestart# enable windows eventlogRUN powershell.exe-command Set-ItemProperty HKLM:\ SYSTEM\ CurrentControlSet\ Control\ WMI\ Autologger\ EventLog-Application Start set IIS log fieldsRUN / windows/system32/inetsrv/appcmd.exe set config / section:system.applicationHost/sites / siteDefaults.logFile.logExtFileFlags: "Date Time, ClientIP, UserName, SiteName, ServerIP, Method, UriStem, UriQuery, HttpStatus, Win32Status, TimeTaken, ServerPort, UserAgent, Referer HttpSubStatus "/ commit:apphost# install Oracle ClientADD win64_11gR2_client.zip / win64_11gR2_client.zipADD unzip.exe / unzip.exeRUN / unzip.exe / win64_11gR2_client.zip & & del / S / Q win64_11gR2_client.zipADD client.rsp / client/client.rspRUN / client/setup.exe-silent-force-noconsole-ignoreSysPrereqs-ignorePrereq-waitforcompletion-responseFile C:\ client\ client.rsp & & del / S / Q client#RUN cacls c:\ app / T / E / C / G users : r # deploy webapp#COPY publish / inetpub/wwwroot/html# set entrypoint scriptADD SetHostsAndStartMonitoring.cmd\ SetHostsAndStartMonitoring.cmdENTRYPOINT ["C:\\ SetHostsAndStartMonitoring.cmd"] # declare volumesVOLUME ["c:/inetpub/logs/LogFiles" "C:/inetpub/wwwroot/html"]

The contents of the files involved in Dockerfile are

Sxs # install the package in the\ sources\ sxs\ directory of Windows Server 2016

Unzip.exe # Oracle Client client installation package under the client\ install directory

Win64_11gR2_client.zip # download from the official website by yourself

Client.rsp # Oracle client installation response file

SetHostsAndStartMonitoring.cmd

Client.rsp

Oracle.install.responseFileVersion= http://www.oracle.com/2007/install/rspfmt_clientinstall_response_schema_v11_2_0ORACLE_HOSTNAME= UNIX_GROUP_NAME=INVENTORY_LOCATION=C:\ Program Files\ Oracle\ InventorySELECTED_LANGUAGES=zh_CN,en ORACLE_HOME=C:\ app\ Administrator\ product\ 11.2.0\ client_1ORACLE_BASE=C:\ app\ Administratororacle.install.client.installType=Runtimeoracle.install.client.customComponents= "oracle.precomp:11.2.0.1.0", "oracle.ons:11.2.0.0.0" "oracle.oraolap.mgmt:11.2.0.1.0", "oracle.rdbms.scheduler:11.2.0.1.0" oracle.install.client.customComponents=oracle.install.client.oramtsPortNumber=49152oracle.install.client.schedulerAgentHostName=oracle.install.client.schedulerAgentPortNumber=

SetHostsAndStartMonitoring.cmd

Echo% HOST% > > / Windows/System32/drivers/etc/hosts/windows/system32/inetsrv/appcmd.exe delete site "Default Web Site/" / windows/system32/inetsrv/appcmd.exe add apppool / name: "% site_name%" / managedRuntimeVersion: "v%site_version%.0" / managedPipelineMode:Classic-queueLength:65535/windows/system32/inetsrv/appcmd.exe add site / name: "% site_name%" / physicalPath: "c:\ inetpub\ wwwroot\ html"-serverAutoStart:true / Bindings: http://*:80 / windows/system32/inetsrv/appcmd.exe set site / site.name: "% site_name%" / [path='/'] .applicationPool: "% site_name%" c:\ ServiceMonitor.exe w3svc

Three environment variables are involved in the file

HOST # because windows Docker can't get through-- add-host means host here means host in this way.

Site_name # site domain name

Site_version # .net version

Docker startup example:

Docker run-d-p 80-e site_name=fengwan.blog.51cto.com-e site_version=4-e host= "192.168.2.2 db.51cto.com"-v c:/webroot/fengwan:c:/inetpub/wwwroot/html-v c:/logs:c:/inetpub/logs/logFiles p_w_picpath_name

Tags: Customer client file environment directory three content variable domain name official container method version sample site part support service test image Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia OPPO Reno MySQL Apple MariaDB