MSI Installer in Dockerfile RRS feed

  • Question

  • Hello Board Members,

    I have a question about 2 MSI Files I like to install with a Dockerfile.

    one ist the native Client for SQL Server 2012 and one is SQLCMD.

    I tried the following without succeeding:

    RUN "msiexec.exe", "/i", "c:\Install\sqlncli.msi", "/quiet", "/qn", "IACCEPTSQLNCLILICENSETERMS=YES"

    and this

    RUN "msiexec.exe", "/i", "c:/Install/sqlncli.msi", "/quiet", "/qn", "IACCEPTSQLNCLILICENSETERMS=YES"

    Both methods with [], so:

    RUN ["msiexec.exe", "/i", "c:\Install\sqlncli.msi", "/quiet", "/qn" "IACCEPTSQLNCLILICENSETERMS=YES"]

    Here I get an msiexec is not recognized as an internal or external command error

    then I tried:

    RUN powershell -command start-process c:\Install\sqlncli.msi -ArgumentList '/quiet /qn IACCEPTSQLNCLILICENSETERMS=YES' -Wait

    Here I get no error, but it doesn't install anything. The same with SQLCMD:

    msiexec C:\Install\sqlcmd.msi /quiet /qn

    IACCEPTMSSQLCMDLNUTILSLICENSETERMS=YES with the same methods I used above.

    How Is it possible to install an MSI Installer in Container with a Dockerfile?

    I know that it is possible to get it working inside of a Container, because when I install it manually it works with:

    msiexec c:\Install\sqlncli.msi /quiet /qn /log c:\ncli.log IACCEPTSQLNCLILICENSETERMS=YES


    msiexec C:\Install\sqlcmd.msi /quiet /qn /log c:\sqlcmd.log

    btw. I removed the Parameter for the log File because it was created but empty.

    • Edited by MarcelJoed Wednesday, April 20, 2016 10:44 AM
    Wednesday, April 20, 2016 10:42 AM

All replies

  • Here is what I have used, which worked well. Note that I am using 'start-process' with the -Wait parameter. This builds in a controlled delay, so that Windows Installer can complete the installtion, before moving onto the next step, which in this case is to delete the msi file.

    RUN powershell -Command \ 
    Invoke-WebRequest -Method Get -Uri -OutFile c:\ ; \
    start-Process c:\ -ArgumentList '/qn' -Wait ; \
    Remove-Item c:\ -Force ; \

    Hope this help.


    Wednesday, April 20, 2016 4:11 PM
  • I'll try today and give feedback, thank you! :-),

    ok, sadly, it doesn't work either. He doesn't give me any errors, he just don't install the files.

    • Edited by MarcelJoed Thursday, April 21, 2016 7:41 AM
    Thursday, April 21, 2016 6:05 AM
  • I have created dockerfile with content like:

    FROM windowsservercore
    Run net user administrator password
    Run net user administrator /active:yes
    ADD MSI/TestMSI1.msi
    ADD MSI/TestMSI2.msi
    Run msiexec.exe /i "C:\MSI\TestMSI1.msi" /qn
    Run msiexec.exe /i "C:\MSI\TestMSI2.msi" /qn INSTALLDIR="C:\Program Files (x86)\Test\" arg2 arg3 arg4

    This is working fine.
    Thursday, June 16, 2016 9:14 AM