I am trying create a Docker image to host my asp.net MVC app that has a dependency on Crystal Reports.
My dockerfile looks like this
FROM microsoft/iis
COPY ./bin/Release/Publish/ c:\\inetpub\\wwwroot
RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
#install Crystal reports runtime
COPY Resources/Files/CRRuntime_64bit_13_0_21.msi .
RUN powershell.exe -Command Start-Process CRRuntime_64bit_13_0_21.msi -ArgumentList '/quiet' -Wait
The installing of the CRRuntime_64bit_13_0_21.msi fails. I logged onto my container and ran the msi install from powershell and produced a log. Its very long but here are 2 things that stand out:
Error 1904. Module C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64\pageobjectmodel.dll failed to register. HRESULT -2147024770. Contact your support personnel.
Action ended 17:20:50: InstallFinalize. Return value 3.
Action ended 17:23:56: INSTALL. Return value 3.
MSI (s) (3C:54) [17:23:56:467]: Product: SAP Crystal Reports runtime engine for .NET Framework (64-bit) -- Installation operation failed.
MSI (s) (3C:54) [17:23:56:467]: Windows Installer installed the product. Product Name: SAP Crystal Reports runtime engine for .NET Framework (64-bit). Product Version: 13.0.21.2533. Product Language: 1033. Manufacturer: SAP. Installation success or error status: 1603.
The first error does not seem to halt the install.
Any suggestions for troubleshooting this are welcome as are alternative ways of creating the image.
Also, just to confirm. The website loads and runs fine. I just can't use any of the features that require the Crystal Reports dependency.
Using the full Windows 2019 container mcr.microsoft.com\windows:1809 as a base, the installer works, which hints that it's just down to missing OS components.
I don't get the 'Error 1904' logged but maybe I'm on a different host OS.
The installer log shows that a custom action SetASPDotNetDllPath is failing.
If you:
Open the installer MSI (e.g. in Orca)
Locate and extract the action binary, save as dll
Inspect its imports (e.g. with dumpbin)
This shows a dependency on oledlg.dll.
This is its only dependency which isn't available in Server Core.
Its not great, but you can copy this version from the full windows container to fix it:
FROM mcr.microsoft.com/windows:1809 as dll_source
FROM microsoft/iis
#hack in oledlg dll!!
COPY --from=dll_source /windows/system32/oledlg.dll /windows/system32/oledlg.dll
COPY --from=dll_source /windows/syswow64/oledlg.dll /windows/syswow64/oledlg.dll
RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
WORKDIR c:/temp
COPY CRRuntime_64bit_13_0_21.msi .
RUN powershell.exe -Command Start-Process c:\temp\CRRuntime_64bit_13_0_21.msi -ArgumentList '/l*v c:\temp\install.log' -Wait
I'm going to add an additional answer while Peters answer worked perfectly for installing Crystal Reports, I had an additional issue with missing Fonts when exporting to PDF from Crystal Report.
This is what I've ended up with. The key is the change in the image tag name to be an older version.
#windowsservercore-1803 required as it has the fonts we need in the report in order to export to PDF
FROM microsoft/iis:windowsservercore-1803
#install features we need
RUN ["powershell.exe", "Install-WindowsFeature NET-Framework-45-ASPNET"]
RUN ["powershell.exe", "Install-WindowsFeature Web-Asp-Net45"]
#hack in oledlg dll so that Crystal Runtime will install
COPY Resources/Files/64/oledlg.dll /windows/syswow64/oledlg.dll
COPY Resources/Files/32/oledlg.dll /windows/system32/oledlg.dll
#copy in Crystal MSI and install. Note it's 64bit version
WORKDIR c:/temp
COPY Resources/Files/CRRuntime_64bit_13_0_21.msi .
RUN powershell.exe -Command Start-Process c:\temp\CRRuntime_64bit_13_0_21.msi -ArgumentList '/quiet /l*v c:\temp\install64.log' -Wait
#Add website files
COPY ./bin/Release/Publish/ /inetpub/wwwroot
For some reason Microsoft have dropped lots of fonts from version 1803 to 1809. I can only assume to reduce the OS image size.
Related
I am a little bit confused how containers run. I am developing on a Mac and when I copy my compiled sources into a docker image and Debian OS, I get an error that the file can not be executed. I googled it and it has something to do with different CPU architectures, I needed to cross compile. That makes sense.
This however work:
FROM rust:1.65 AS builder
WORKDIR app
COPY . .
RUN cargo build --release
FROM debian:buster-slim
COPY --from=builder ./app/target/release/hello ./app/myapp
CMD ["./app/myapp"]
I can build a binary without knowing in advance which architecture I am compiling for right? This is because I just do a cargo build on a builder called rust:1.65. I am curious how it does know it will be ran on Debian and on the correct CPU.
How does FROM rust:1.65 compile for the correct architecture? Or is it just all the same default architecture in a Dockerfile?
Which operating system is (likely) a more significant variable than which processor architecture.
The Docker core doesn't run natively on MacOS. Docker Desktop runs a hidden Linux virtual machine. In the case where you're compiling the binary on the host, you get a MacOS binary, but then you try to run it in a Linux container, which results in an error. If you do the compilation in a container too, it's all Linux.
More generally, there are also lurking problems around shared libraries, support files, permissions, ... and unless you're confident in what you're doing I would not try to build binaries on the host and copy them into an image or container. Install them in the image, either compiling them yourself or using the base image distribution's package manager.
You can compile for the given architecture.
Run the following command to see all target availlable. doc
docker run --rm -ti rust:1.65 rustc --print target-list
and in you Toml config you setup the buil option. doc
[build]
target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu"]
I have windows 10 OS with WSL enabled and docker for windows installed.
When I type docker in PowerShell and hit tab, it suggests me with the corresponding folders and files in my working directory.
here AndroidStudioProjects is a directory in my working directory.
On the other hand,
When I type docker in WSL Ubuntu and hit tab, it suggests the available docker commands themselves. (My expected behavior)
I want PowerShell to also recommend like WSL ubuntu.
Presumably:
docker on WSL comes with tab-completion for POSIX-compatible shells such as bash, installed via the shell's initialization files.
no such support is provided for PowerShell, but there are third-party solutions - see below.
Installing PowerShell tab-completion for docker:
Install the DockerCompletion module from the PowerShell Gallery:
# Install the module in the scope of the current user.
Install-Module DockerCompletion -Scope CurrentUser
# Import the module into the session.
# Add this line to your $PROFILE file to make the tab-completion
# available in future sessions.
Import-Module DockerCompletion
Installing PowerShell tab-completion for all supported programs (CLIs):
The posh-cli meta-module - whose repo is here - offers a convenient way to automatically install tab-completion support for all locally installed CLIs for which application-specific tab-completion modules are available:
# Install the meta-module in the scope of the current user.
Install-Module posh-cli -Scope CurrentUser
# This looks for locally installed CLIs for which tab-completion
# modules are available, installs them, and adds
# Import-Module commands to your $PROFILE file.
Install-TabCompletion
See the README for more information.
I am trying to create custom docker image for Alfresco 6.2, I already did the set-up for Alfresco 6.2 docker container and it's up and running fine.
Now I have to create custom docker image by adding/installing following amp files in the custom image.
alfresco-content-connector-for-salesforce-repo-2.1.x.amp
alfresco-content-connector-for-salesforce-share-2.1.x.amp
Can someone please share the exact steps to generate custom docker images?
I have following commands in my Fockerfile
FROM alfresco/alfresco-content-repository-community:6.2.0-ga
ARG TOMCAT_DIR=/usr/local/tomcat \
ADD alfresco-content-connector-for-salesforce-repo-2.1.x.amp ${TOMCAT_DIR}/amps
RUN java -jar ${TOMCAT_DIR}/alfresco-mmt/alfresco-mmt*.jar install \ ${TOMCAT_DIR}/amps ${TOMCAT_DIR}/webapps/alfresco --nobackup
And I am getting following error after executing command:-
docker build -t customacs/acs-platform .
05290000 An IO error was encountered during deployment of the AMP into the WAR
Any help will be appreciated.
Thanks in Advance
Use the root user to build the docker file.
Docker file for repo amp:
FROM alfresco/alfresco-content-repository-community:6.2.0-ga
USER root
COPY ./amps/alfresco-content-connector-for-salesforce-repo-2.1.x.amp /usr/local/tomcat/amps/
RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps /usr/local/tomcat/webapps/alfresco -directory -nobackup -force \
&& chown -R root:Alfresco /usr/local/tomcat
USER alfresco
Docker file for share amp :
FROM alfresco/alfresco-share:6.2.0
COPY ./amps/alfresco-content-connector-for-salesforce-share-2.1.x.amp /usr/local/tomcat/amps_share/
RUN java -jar /usr/local/tomcat/alfresco-mmt/alfresco-mmt*.jar install /usr/local/tomcat/amps_share /usr/local/tomcat/webapps/share -directory -nobackup -force \
I have faced a similar issue but not the same.
Error Message: 08160000 An IO error was encountered during deployment of the AMP into the WAR
The most likely reason for this error is due to lack of permission to update the war or files in the webapp. You may run the MMT utility with the '-verbose' flag to find out what file/directory is being updated right before the exception is thrown. That resource is typically the reason for the error.
Share Connector is for Enterprise only. It looks like you are trying to install it on the Community Edition stack:
FROM alfresco/alfresco-content-repository-community:6.2.0-ga
Cheers,
Eddie
I'm attempting to containerize a legacy ASP.NET application that has a dependency on Web Services Enhancements (WSE) 3.0. I understand that this is a legacy technology but refactoring the application to remove it is not an option.
My Dockerfile:
FROM mcr.microsoft.com/windows/servercore/iis
RUN mkdir prereqs
WORKDIR /prereqs
COPY ["prereqs/WSE30.msi", "c:/prereqs/"]
RUN "C:\prereqs\WSE30.msi /qn /quiet /passive"
Which fails with the following:
The command 'cmd /S /C "C:\prereqs\WSE30.msi /qn /quiet /passive"' returned a non-zero code: 1603
I've tried modifying the RUN command to include logging...
RUN "C:\prereqs\WSE30.msi /qn /quiet /passive /lv c:/logs/wse30.txt"
...but this creates a condition where the docker build just seems to hang; I've let several of these attempts run for more than an hour and they do not appear to progress or complete.
I've also tried adding an "exit 0" to simply let the build continue if there is an error...
RUN "C:\prereqs\WSE30.msi /qn /quiet /passive /lv c:/logs/wse30.txt" ; exit 0
..but the result is the same. The build appears to hang and never complete.
I know that this particular MSI supports unattended/silent installation as I've done so in batch files.
#DWRoelands , I faced the same issue but I was able to install it on the windowservercore:1909 after installing the all web-serverr and all its subcomponents components.
You will have to set the source of .Net3.5 to the downloaded file of https://dotnetbinaries.blob.core.windows.net/dockerassets/microsoft-windows-netfx3-1909.zip
I am running the vanilla ASP.Net VNext hello world application with dnx. When i perform "dnx . run", it runs just fine. But when i am using "dnu publish" to create the self contained package (as a result of which it creates web.cmd), it fails to run on linux with the errors
root#Xavier:~/Net/HelloWorldCore/bin/output# web.cmd
web.cmd: command not found
i tired doing "chmod 777 web.cmd", it then fails to recognize dnx
root#Xavier:~/Net/HelloWorldCore/bin/output# chmod 777 web.cmd
root#Xavier:~/Net/HelloWorldCore/bin/output# ./web.cmd
./web.cmd: line 1: $'\r': command not found
./web.cmd: line 2: #dnx.exe: command not found
I am using Ubuntu 14.04
root#Xavier:~/dnvm list
Active Version Runtime Arch Location Alias
------ ------- ------- ---- -------- -----
1.0.0-beta4 coreclr x64 ~/.dnx/runtimes
1.0.0-beta5 mono ~/.dnx/runtimes default
1.0.0-beta6-12207 coreclr x64 ~/.dnx/runtimes
1.0.0-beta6-12207 mono ~/.dnx/runtimes
* 1.0.0-beta4 mono ~/.dnx/runtimes
On Linux you don't run the .cmd files. Cmd is just for Windows. Just run the command name, without any extension: ./web.