新版的Windows 2016已經(jīng)支持原生Docker,現(xiàn)在也將部分服務往Docker上遷移進行測試。
創(chuàng)新互聯(lián)建站是一家集網(wǎng)站建設,隴南企業(yè)網(wǎng)站建設,隴南品牌網(wǎng)站建設,網(wǎng)站定制,隴南網(wǎng)站建設報價,網(wǎng)絡營銷,網(wǎng)絡優(yōu)化,隴南網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強企業(yè)競爭力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時我們時刻保持專業(yè)、時尚、前沿,時刻以成就客戶成長自我,堅持不斷學習、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實用型網(wǎng)站。
環(huán)境中有使用.net 3.5和.net 4.0以及有使用Oracle客戶端,因此Web容器就需要安裝Oracle客戶端
Dockerfile
FROM microsoft/iis # install .NET 3.5 ADD sxs /sxs RUN Dism /online /enable-feature /featurename:NetFX3 /All /Source:C:\sxs /LimitAccess && del /S /Q C:\sxs # install ASP.NET 4.5 RUN dism /online /enable-feature /all /featurename:NetFx4 /featurename:IIS-ApplicationInit /featurename:IIS-ASPNET45 /featurename:IIS-ASPNET /NoRestart # enable windows eventlog RUN powershell.exe -command Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-Application Start 1 # set IIS log fields RUN /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 Client ADD win64_11gR2_client.zip /win64_11gR2_client.zip ADD unzip.exe /unzip.exe RUN /unzip.exe /win64_11gR2_client.zip && del /S /Q win64_11gR2_client.zip ADD client.rsp /client/client.rsp RUN /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 script ADD SetHostsAndStartMonitoring.cmd \SetHostsAndStartMonitoring.cmd ENTRYPOINT ["C:\\SetHostsAndStartMonitoring.cmd"] # declare volumes VOLUME ["c:/inetpub/logs/LogFiles","C:/inetpub/wwwroot/html"]
Dockerfile涉及的文件內(nèi)容有
sxs #在Windows Server 2016 安裝包的\sources\sxs\目錄
unzip.exe #Oracle Client客戶端安裝包的client\install目錄下
win64_11gR2_client.zip #自行到官方下載
client.rsp #Oracle客戶端安裝響應文件
SetHostsAndStartMonitoring.cmd
client.rsp
oracle.install.responseFileVersion=http://www.oracle.com/2007/install/rspfmt_clientinstall_response_schema_v11_2_0 ORACLE_HOSTNAME= UNIX_GROUP_NAME= INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory SELECTED_LANGUAGES=zh_CN,en ORACLE_HOME=C:\app\Administrator\product\11.2.0\client_1 ORACLE_BASE=C:\app\Administrator oracle.install.client.installType=Runtime oracle.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=49152 oracle.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
文件中涉及到三個環(huán)境變量
HOST #因為windows Docker無法通過--add-host指host這里通過這種方法指host
site_name #站點域名
site_version #.net版本
Docker啟動示例:
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
分享題目:WindowsDocker鏡像構建之Oracle客戶端
當前地址:http://www.rwnh.cn/article42/jdjjhc.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設計、網(wǎng)站改版、微信小程序、品牌網(wǎng)站設計、網(wǎng)站制作、
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)