Automated installer build using docker
Automated installer build using docker
We use, and have licensed, studio admin.
I wrote scripts that utilize miabuild to automate the creation of various product installers. I verified these scripts execute successfully when tested locally on a windows server 2022 machine, with admin studio installed locally.
The goal is to dockerize this step and integrate it with a CI/DI pipeline that uses docker for individual steps, as is the norm these days.
I looked for an existing docker image that I could base this on but was unable to find one. So, I attempted to create my own. I posted a redacted version of my docker file below.
Note I tried this in various ways, with various base operating systems, different command line parameters, etc. It does not seem to be able to get through this -- I have spent almost a week on this and am close to giving up.
Questions:
1. Since dockerizing CI/DI build steps such as this is common practice nowadays, does a premade docker image exist that I can use?
2. If not, can detailed steps be provided on how this can be achieved?
Thanks in advance!
=================================================================
# Dockerfile
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["cmd", "/S", "/C"]
#### (snipped:) Install 7-zip, Git
COPY InstallAware_X16.exe C:/install/
COPY [license file].exe C:/install/
# Set the working directory
WORKDIR C:/install
RUN cmd /c InstallAware_X16.exe /k="[password]" /s /l="C:\\IA_install_log.txt" TARGETDIR="C:\\Program Files (x86)\\InstallAware" || echo "Installation failed, attempting to copy log"
COPY C:\IA_install_log.txt C:/install_log_host.txt #### Note: No such log exists.... The process exists with error code 1
### install other dependencies - we never get here ####
RUN cmd /c [license file].exe /s
#### (snipped:) Remove dependencies
=================================================================
Docker build failure message:
RUN cmd /c InstallAware_X16.exe /k="[redacted]" /s /l=C:\IA_install_log.txt TARGETDIR="C:\\Program Files (x86)\\InstallAware"
---> Running in cc5c31998167
The command 'cmd /S /C cmd /c InstallAware_X16.exe /k="[redacted]" /s /l=C:\IA_install_log.txt TARGETDIR="C:\\Program Files (x86)\\InstallAware"' returned a non-zero code: 1
I wrote scripts that utilize miabuild to automate the creation of various product installers. I verified these scripts execute successfully when tested locally on a windows server 2022 machine, with admin studio installed locally.
The goal is to dockerize this step and integrate it with a CI/DI pipeline that uses docker for individual steps, as is the norm these days.
I looked for an existing docker image that I could base this on but was unable to find one. So, I attempted to create my own. I posted a redacted version of my docker file below.
Note I tried this in various ways, with various base operating systems, different command line parameters, etc. It does not seem to be able to get through this -- I have spent almost a week on this and am close to giving up.
Questions:
1. Since dockerizing CI/DI build steps such as this is common practice nowadays, does a premade docker image exist that I can use?
2. If not, can detailed steps be provided on how this can be achieved?
Thanks in advance!
=================================================================
# Dockerfile
FROM mcr.microsoft.com/windows/servercore:ltsc2022
SHELL ["cmd", "/S", "/C"]
#### (snipped:) Install 7-zip, Git
COPY InstallAware_X16.exe C:/install/
COPY [license file].exe C:/install/
# Set the working directory
WORKDIR C:/install
RUN cmd /c InstallAware_X16.exe /k="[password]" /s /l="C:\\IA_install_log.txt" TARGETDIR="C:\\Program Files (x86)\\InstallAware" || echo "Installation failed, attempting to copy log"
COPY C:\IA_install_log.txt C:/install_log_host.txt #### Note: No such log exists.... The process exists with error code 1
### install other dependencies - we never get here ####
RUN cmd /c [license file].exe /s
#### (snipped:) Remove dependencies
=================================================================
Docker build failure message:
RUN cmd /c InstallAware_X16.exe /k="[redacted]" /s /l=C:\IA_install_log.txt TARGETDIR="C:\\Program Files (x86)\\InstallAware"
---> Running in cc5c31998167
The command 'cmd /S /C cmd /c InstallAware_X16.exe /k="[redacted]" /s /l=C:\IA_install_log.txt TARGETDIR="C:\\Program Files (x86)\\InstallAware"' returned a non-zero code: 1
Re: Automated installer build using docker
This topic applies to InstallAware Multi Platform as well.
What comes to mind is that you're not quoting the parameters accurately.
You need to enclose the whole flag=parameter or variable=value pair inside double quotes, not just the second half.
Please try that and let us know how it goes!
What comes to mind is that you're not quoting the parameters accurately.
You need to enclose the whole flag=parameter or variable=value pair inside double quotes, not just the second half.
Please try that and let us know how it goes!
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Thanks. Took a while to respond, but I tried the following and have better results, but still not the solution.
New Dockerfile:
=================================
FROM mcr.microsoft.com/dotnet/framework/sdk:3.5-windowsservercore-ltsc2019
SHELL ["cmd", "/S", "/C"]
# Copy the InstallAware setup and other plugins to the container
COPY InstallAware_X16.exe C:/install/
COPY [license file].exe C:/install/
COPY AxoNetPlugins.exe C:/install/
COPY CamelotPlugins.exe C:/install/
COPY mdPlugins.exe C:/install/
# Set the working directory
WORKDIR C:/install
# Execute the InstallAware setup and other plugins using CMD pattern
RUN cmd /c InstallAware_X16.exe "/k=[redacted]" "/s" "/l=C:\\IA_install_log.txt" "TARGETDIR=C:\\Program Files (x86)\\InstallAware"
COPY C:\IA_install_log.txt C:/install_log_host.txt
RUN cmd /c [license file -- reacted].exe /s
RUN cmd /c AxoNetPlugins.exe /s
RUN cmd /c CamelotPlugins.exe /s
RUN cmd /c mdPlugins.exe /s
# Clean up the installation directory
RUN powershell -Command "Remove-Item -Path C:/install/* -Recurse -Force"
# Specify the default command for the container
CMD ["cmd.exe"]
=================================
The installer ran for a long while, but did not exit. When inspecting the container, I can see c:\ia_install_log.txt is being written. It is 34831 lines long and ends in this:
=================================
<NATIVE INSTALL>
<Delete Files>
< C:\Program Files (x86)\InstallAware\miaui.dat >
</Delete Files>
</NATIVE INSTALL>
<NATIVE INSTALL>
<Delete Files>
< C:\Program Files (x86)\InstallAware\ui.buf >
</Delete Files>
</NATIVE INSTALL>
=================================
After that, no more activitly; hangs at RUN cmd /c InstallAware_X16.exe, even after I let it sit for another 2 hours. I am using a fairly powerfull machine.
Any suggestions?
In general, I would repeat the request to provide a premade docker image for your releases. They do not need to be licensed. Licensed users can just add an additional layer on top that licenses the product and installs any needed plugins/extensions. Since this is the industry wide practice these days (Azure, Github, GitLab, AWS ... All the major players expect this in their build pipelines), I would expect no less.
Thanks again!
New Dockerfile:
=================================
FROM mcr.microsoft.com/dotnet/framework/sdk:3.5-windowsservercore-ltsc2019
SHELL ["cmd", "/S", "/C"]
# Copy the InstallAware setup and other plugins to the container
COPY InstallAware_X16.exe C:/install/
COPY [license file].exe C:/install/
COPY AxoNetPlugins.exe C:/install/
COPY CamelotPlugins.exe C:/install/
COPY mdPlugins.exe C:/install/
# Set the working directory
WORKDIR C:/install
# Execute the InstallAware setup and other plugins using CMD pattern
RUN cmd /c InstallAware_X16.exe "/k=[redacted]" "/s" "/l=C:\\IA_install_log.txt" "TARGETDIR=C:\\Program Files (x86)\\InstallAware"
COPY C:\IA_install_log.txt C:/install_log_host.txt
RUN cmd /c [license file -- reacted].exe /s
RUN cmd /c AxoNetPlugins.exe /s
RUN cmd /c CamelotPlugins.exe /s
RUN cmd /c mdPlugins.exe /s
# Clean up the installation directory
RUN powershell -Command "Remove-Item -Path C:/install/* -Recurse -Force"
# Specify the default command for the container
CMD ["cmd.exe"]
=================================
The installer ran for a long while, but did not exit. When inspecting the container, I can see c:\ia_install_log.txt is being written. It is 34831 lines long and ends in this:
=================================
<NATIVE INSTALL>
<Delete Files>
< C:\Program Files (x86)\InstallAware\miaui.dat >
</Delete Files>
</NATIVE INSTALL>
<NATIVE INSTALL>
<Delete Files>
< C:\Program Files (x86)\InstallAware\ui.buf >
</Delete Files>
</NATIVE INSTALL>
=================================
After that, no more activitly; hangs at RUN cmd /c InstallAware_X16.exe, even after I let it sit for another 2 hours. I am using a fairly powerfull machine.
Any suggestions?
In general, I would repeat the request to provide a premade docker image for your releases. They do not need to be licensed. Licensed users can just add an additional layer on top that licenses the product and installs any needed plugins/extensions. Since this is the industry wide practice these days (Azure, Github, GitLab, AWS ... All the major players expect this in their build pipelines), I would expect no less.
Thanks again!
Re: Automated installer build using docker
There's still a couple things we can try out first.
1. A flag to disable hard link generation, in case that is choking Docker. Just add this to your command line:
And try again. Please ensure to share the resulting setup log from InstallAware's own installation itself.
2. If that fails too, just try copying files over, and registering the plug-ins manually?
a. You want to copy everything in:
Including all subfolders.
b. You want to export and merge everything in:
Please let us know what you find - thank you!
1. A flag to disable hard link generation, in case that is choking Docker. Just add this to your command line:
Code: Select all
NATIVE_HARDLINK=FALSE
And try again. Please ensure to share the resulting setup log from InstallAware's own installation itself.
2. If that fails too, just try copying files over, and registering the plug-ins manually?
a. You want to copy everything in:
Code: Select all
C:\Program Files (x86)\InstallAware X16
Including all subfolders.
b. You want to export and merge everything in:
Code: Select all
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MimarSinan\InstallAware\2.0
Please let us know what you find - thank you!
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Thanks, I tried it with the NATIVE_HARDLINK=FALSE flag but the same results; It hangs at the exact same spot in the log file.
Please see the attached installer log, I omitted the registration step so no sensitive info should be in there.
As for the brute for method (copy content and registry settings); Is this really a recommended approach? That seems very odd coming from this particular company
. I would rather not, obviously, but when I get some time I may try.
Please see the attached installer log, I omitted the registration step so no sensitive info should be in there.
As for the brute for method (copy content and registry settings); Is this really a recommended approach? That seems very odd coming from this particular company
![Very Happy :D](./images/smilies/icon_biggrin.gif)
- Attachments
-
- ia_install_log.txt
- (456.47 KiB) Downloaded 41 times
Re: Automated installer build using docker
Docker's ultimately an application virtualization platform, and based on the log you have shared, it is choking either when file system permissions are being applied, or while application pins are being placed. I'd place my bet on the latter scenario.
I'm afraid working around issues in third party software is a bit above my capabilities here, but I've already escalated this to the team for investigation and resolution.
Given the prominence of Docker, I would imagine a prompt response from R&D. In the meanwhile, it would still be helpful of course, were you to give the brute force approach a go.
I'm afraid working around issues in third party software is a bit above my capabilities here, but I've already escalated this to the team for investigation and resolution.
Given the prominence of Docker, I would imagine a prompt response from R&D. In the meanwhile, it would still be helpful of course, were you to give the brute force approach a go.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Forgot to mention that at the point where Docker does seem to choke the installer, the setup files - and registry entries - should all be in place already.
I'd try using the resulting container (killing the hung installer process) as an alternative approach (to manually copying over files and registry keys from a non-containerized environment) - that would most likely work already.
I'd try using the resulting container (killing the hung installer process) as an alternative approach (to manually copying over files and registry keys from a non-containerized environment) - that would most likely work already.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Well, that was quick!
Please download the latest web build from www.installaware.com/00/myahew_sw.exe.
Please add the parameter DISKZIP:FALSE to the existing command line.
Just test the minimum install - it ought to work fine, is what I am told - but we'll still wait for you to verify before going live.
Please download the latest web build from www.installaware.com/00/myahew_sw.exe.
Please add the parameter DISKZIP:FALSE to the existing command line.
Just test the minimum install - it ought to work fine, is what I am told - but we'll still wait for you to verify before going live.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Thank you for the quick response. I will get to trying this out ASAP and let you know my results.
When you say "minimal install", are there any specific command line parameters you would like me to use?
An example template of what I should be using for the RUN command would be appreciated.
Thanks.
When you say "minimal install", are there any specific command line parameters you would like me to use?
An example template of what I should be using for the RUN command would be appreciated.
Thanks.
Re: Automated installer build using docker
What you used before ought to work well, with the addition as above:
The web build already defaults to the minimum install, so no further switches ought to be required for that.
BTW is there any reason you're having cmd.exe run the setup program, instead of launching it directly?
Edit: Just noticed your TARGETDIR override would be ignored unless you are using a : instead of a =, only the former of which would lock the variable into the value specified on the command line for the duration of the script execution:
www.installaware.com/mh52/desktop/setup ... meters.htm
Hope that helps!
Code: Select all
RUN cmd /c InstallAware_X16.exe "/k=[redacted]" "/s" "/l=C:\\IA_install_log.txt" "TARGETDIR=C:\\Program Files (x86)\\InstallAware" "DISKZIP:FALSE"
The web build already defaults to the minimum install, so no further switches ought to be required for that.
BTW is there any reason you're having cmd.exe run the setup program, instead of launching it directly?
Edit: Just noticed your TARGETDIR override would be ignored unless you are using a : instead of a =, only the former of which would lock the variable into the value specified on the command line for the duration of the script execution:
www.installaware.com/mh52/desktop/setup ... meters.htm
Hope that helps!
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Thanks for this. It took me a while to get back to this, but good news! I was able to succesfully build the docker image using the commands outlined above.
Inspecting the container, it looks like the content that I expected is there. I do need to hone this a bit further to ensure we can actually build the installers for our products, I have not yet tried. I will keep you posted, I hope to test within the next few days or early next week.
Inspecting the container, it looks like the content that I expected is there. I do need to hone this a bit further to ensure we can actually build the installers for our products, I have not yet tried. I will keep you posted, I hope to test within the next few days or early next week.
Re: Automated installer build using docker
First issue I ran into; It does not seem that miabuild.exe is present on the docker container. Is there some sort of flag that needs to be passed into the installer process to enable it to be delivered? Searching c:\program files (x86) did not find it for me, nor is it on the path.
Last edited by bdlbcc on Thu Apr 04, 2024 2:53 pm, edited 2 times in total.
Re: Automated installer build using docker
That is great to hear!
Yes, the file you tested is the minimum installation scenario, which wouldn't install the command line build tool by design.
Now that we've validated the fix works, I'll be sure to let the stakeholders involved know they may push this fix into production.
Then you would be able to just download from the public download page:
www.installaware.com/downloads-product-downloads.htm
And install normally within Docker.
Keep an eye out here.
Yes, the file you tested is the minimum installation scenario, which wouldn't install the command line build tool by design.
Now that we've validated the fix works, I'll be sure to let the stakeholders involved know they may push this fix into production.
Then you would be able to just download from the public download page:
www.installaware.com/downloads-product-downloads.htm
And install normally within Docker.
Keep an eye out here.
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Re: Automated installer build using docker
Thank you John!
When the update is pushed to the downloads page, could you please be sure to add an (optional?) flag to install the command line utilities and let me know how to pass it in? After all, the point of implementing this in Docker is to automate the process, which means command line support.
I will keep an eye out on this thread.
When the update is pushed to the downloads page, could you please be sure to add an (optional?) flag to install the command line utilities and let me know how to pass it in? After all, the point of implementing this in Docker is to automate the process, which means command line support.
I will keep an eye out on this thread.
Re: Automated installer build using docker
Great news, this build is now live on the public download page I had previously referenced above.
You may install it using the following command line:
The last two parameters are only required if you're using the web build to install, as that one defaults to a minimum setup (which wouldn't install the command line build tool you're after).
You may install it using the following command line:
Code: Select all
RUN cmd /c InstallAware_X16.exe "/k=[redacted]" "/s" "/l=C:\\IA_install_log.txt" "TARGETDIR=C:\\Program Files (x86)\\InstallAware" "COMPLETE:TRUE" "MINIMUM:FALSE"
The last two parameters are only required if you're using the web build to install, as that one defaults to a minimum setup (which wouldn't install the command line build tool you're after).
John Gaver
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
InstallAware Skunkworks
InstallAware Multi Platform - Liberating DEB/RPM/PKG/MSI(X) into universal native setups!
Get your free copy today - https://www.installaware.com/installaware-multi-platform.htm
Who is online
Users browsing this forum: Google [Bot] and 41 guests