unable to run copy command using docker file - copy

I am trying to run copy command in docker file but getting error as below :
RUN mkdir C:\RPS
COPY C:\inetpub\wwwroot\RpsSetup\MSI\6.5 C:\RPS
RUN Write-Host 'Installing RPS' ; \
Start-Process msiexec.exe -ArgumentList '/i', 'rps64.msi', '/quiet', '/norestart' -NoNewWindow -Wait
COPY C:\inetpub\wwwroot\RpsSetup\MSI\6.5 C:\RPS
failed to build: COPY failed: CreateFile \?\C:\ProgramData\Docker\tmp\docker-builder075489208\C:inetpubwwwrootRpsSetupMSI6.5: The system cannot find the file specified.

Related

Parameter interups docker build

I've created a dockerfile and now I want to build it, but I need to run a powershell command with a parameter inside. Running the command outside the docker build, then it works fine. Unfortionatly not when I run it inside the docker build.
Dockerfile:
FROM microsoft/nanoserver COPY wrapperfiles /wrapperfiles
RUN powershell start-process -filepath "C:\wrapperfiles\wrapper.exe -s C:\wrapperfiles\tomcat-wrapper-default.conf"
EXPOSE 80
CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
Now when I want to build it, then it comes with the following error:
Sending build context to Docker daemon 1.664GB Step 1/5 : FROM microsoft/nanoserver ---> e2c314f76df6 Step 2/5 : COPY wrapperfiles /wrapperfiles ---> Using cache ---> 6047da8320f0 Step 3/5 : RUN powershell start-process -filepath "C:\wrapperfiles\wrapper.exe -s C:\wrapperfiles\tomcat-wrapper-default.conf" ---> Running in 0d6b47577b35 Start-Process : A parameter cannot be found that matches parameter name 's'. At line:1 char:75
+ ... filepath C:\wrapperfiles\wrapper.exe -s C:\wrapper ...
+ ~~
+ CategoryInfo : InvalidArgument: (:) [Start-Process], ParameterB indingException
+ FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm ands.StartProcessCommand
The command 'cmd /S /C powershell start-process -filepath "C:\wrapperfiles\wrapper.exe -s C:\wrapperfiles\tomcat-wrapper-default.conf"' returned a non-zero code: 1
How can I get the -s parameter included in the filepath command?
How can I get the -s parameter included in the filepath command?
-s cannot be part of a filepath, unless you have a file literally called C:\wrapperfiles\wrapper.exe -s C:\wrapperfiles\tomcat-wrapper-default.conf.
Probably you want to include -s and C:\wrapperfiles\tomcat-wrapper-default.conf as arguments, so try:
RUN powershell start-process -filepath "C:\wrapperfiles\wrapper.exe" -ArgumentList "-s","C:\wrapperfiles\tomcat-wrapper-default.conf"

Powershell installing msi

I am using docker with powershell. I want to download and install webdeploy .msi
I am using the following code:
RUN Invoke-WebRequest http://download.microsoft.com/download/0/1/D/01DC28EA-638C-4A22-A57B-4CEF97755C6C/WebDeploy_x86_en-US.msi -OutFile webdeploy.msi; \
Start-Process msiexec -Wait -ArgumentList /q, /i, -PassThru, webdeploy.msi ; \
Remove-Item -Force webdeploy.msi
When I run:
docker build -t test.
Everything goes fine.
When I then check the folder "Program Files (x86)" inside the container I dont see any folder "IIS".
I also tried:
RUN Invoke-WebRequest http://download.microsoft.com/download/0/1/D/01DC28EA-638C-4A22-A57B-4CEF97755C6C/WebDeploy_x86_en-US.msi -OutFile webdeploy.msi; \
Start-Process msiexec -Wait -ArgumentList /q, /i, webdeploy.msi ; \
Remove-Item -Force webdeploy.msi
Some help would be appreciated.

Start-Process cmdlet with -ArgumentList throw "Invalid Argument" error

I want to register a dll using gacutil.exe.
Start-Process -Wait -FilePath "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" -ArgumentList '/u', "USB\CRM\Common"
It throw the error:
You don't need Start-Process if you just want to run a command at the PowerShell command line. PowerShell can run commands typed at its prompt. (It's a shell; one of the purposes of a shell is to run commands you enter.) Since the command contains spaces, enclose it in " and execute it with the & (call or invocation) operator.
& "C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools\gacutil.exe" /u USB\CRM\Common

DockerFile call install msi

I'm having a hard time installing an msi via Dockerfile. My Dockerfile:
FROM microsoft/windowsservercore:latest
RUN mkdir C:\temp
RUN mkdir C:\temp\msis
COPY . "C:/temp/msis"
RUN powershell -version 5.0 -command { Start-process -Filepath "C:\temp\msis\mySetup.msi" -ArgumentList "/qn" -PassThru | Wait-Process}
When running docker build via:
docker build -t myTools .
I get the following error:
Step 7/7 : RUN powershell -version 5.0 -command { Start-process -Filepath "C:\temp\msis\mySetup.msi" -ArgumentList "/qn" -PassThru | Wait-Process}
---> Running in d6f9f65d96a9
'Wait-Process}' is not recognized as an internal or external command,operable program or batch file.
If I build the container without the RUN step, and attach myself via -it to the running container and paste the command powershell -version 5.0 -command { Start-process -Filepath "C:\temp\msis\mySetup.msi" -ArgumentList "/qn" -PassThru | Wait-Process} the MSI gets installed correctly.
Has anyone an idea this failure happens?
Thx
Possibly it's a PowerShell parsing problem.
Try these 2 lines instead of your last line:
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
RUN Start-Process 'C:\\temp\\msis\\mySetup.msi' '/qn' -PassThru | Wait-Process;
After that you can revert to cmd.exe if you wish:
SHELL ["cmd", "/C"]

Failed to install [Name] MsiExec returned: 255, when running an cmd file from Powershell

I'm trying to run an MSI install command from Powershell by using a cmd file.
I create my install command:
msiexec /i [insert here a HUGE amount of param values] /lv install.log /passive
I then write it to temp.cmd and then execute from Powershell as follows:
$exitCode = (Start-Process -FilePath "temp.cmd" -Wait -Passthru).ExitCode
I then get the following error message:
CategoryInfo : OperationStopped: 255:StringRuntimeException
FullyQualifiedErrorId
Failed to install [Msi Name] MsiExec returned: 255
What causes this?
If you try and run the MsiExec command I was having trouble with from the commandline, I get the following error message:
The input line is too long
This error isn't obvious when executed in Powershell and you might think its an issue with MsiExec.
This is a bit of a cryptic error message and relates to cmd.exe having a total commandline length of 8191.
See the Microsoft KB article on cmd length: http://support.microsoft.com/kb/830473