0

I'm trying to run the below command inside docker container using Dockerfile

jmeter -n -t nature.jmx -l nature.jtl

I tried running this command using RUN and CMD

CMD ["jmeter", "-n"," -t nature.jmx -l nature1.jtl"]

RUN "jmeter -n -t nature.jmx -l nature.jtl"

RUN jmeter -n -t nature.jmx -l nature.jtl

but none of the above command works. i keep getting the below error:

C:\Program Files\Docker\docker.exe: Error response from daemon: container 02323b3d347904331938b0d27c639975899284b06a0e2f377350 833b55f1ef46 encountered an error during CreateProcess: failure in a Windows system call: The system cannot find the file spec ified. (0x2) extra info: {"ApplicationName":"","CommandLine":"jmeter -n -t nature.jmx -l nature1.jtl","User":"","WorkingDirec tory":"C:\jmeter\apache-jmeter-3.1\bin","Environment":{"JAVA_HOME":"C:\ojdkbuild","JAVA_OJDKBUILD_SHA256":"7e7384636054001 499ba96d55c90fc39cbb0441281254a1e9ac8510b527a7a46","JAVA_OJDKBUILD_VERSION":"1.8.0.131-1","JAVA_OJDKBUILD_ZIP":"java-1.8.0-ope njdk-1.8.0.131-1.b11.ojdkbuild.windows.x86_64.zip","JAVA_VERSION":"8u131","JMETER_HOME":"C:/jmeter/apache-jmeter-3.1","SET":"P ATH=C:ProgramDataOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C :ojdkbuildbin;C:/jmeter/apache-jmeter-3.1bin;"},"EmulateConsole":false,"CreateStdInPipe":true,"CreateStdOutPipe":true,"CreateS tdErrPipe":true,"ConsoleSize":[0,0]}. PS C:\Users\Administrator>

Any advise on this would be helpful. Thanks in advance. Please find my docketing:

Experimental: false PS C:\Users\Administrator> Trying build the image using the below Dockerfile

FROM microsoft/windowsservercore
    # $ProgressPreference: https://github.com/PowerShell/PowerShell/issues/2138#issuecomment-251261324
    SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV JAVA_HOME C:\\ojdkbuild
RUN $newPath = ('{0}\bin;{1}' -f $env:JAVA_HOME, $env:PATH); \
    Write-Host ('Updating PATH: {0}' -f $newPath); \
# Nano Server does not have "[Environment]::SetEnvironmentVariable()"
    setx /M PATH $newPath;

# https://github.com/ojdkbuild/ojdkbuild/releases
ENV JAVA_VERSION 8u131
ENV JAVA_OJDKBUILD_VERSION 1.8.0.131-1
ENV JAVA_OJDKBUILD_ZIP java-1.8.0-openjdk-1.8.0.131-1.b11.ojdkbuild.windows.x86_64.zip
ENV JAVA_OJDKBUILD_SHA256 7e7384636054001499ba96d55c90fc39cbb0441281254a1e9ac8510b527a7a46

RUN $url = ('https://github.com/ojdkbuild/ojdkbuild/releases/download/{0}/{1}' -f $env:JAVA_OJDKBUILD_VERSION, $env:JAVA_OJDKBUILD_ZIP); \
    Write-Host ('Downloading {0} ...' -f $url); \
    Invoke-WebRequest -Uri $url -OutFile 'ojdkbuild.zip'; \
    Write-Host ('Verifying sha256 ({0}) ...' -f $env:JAVA_OJDKBUILD_SHA256); \
    if ((Get-FileHash ojdkbuild.zip -Algorithm sha256).Hash -ne $env:JAVA_OJDKBUILD_SHA256) { \
        Write-Host 'FAILED!'; \
        exit 1; \
    }; \
    \
    Write-Host 'Expanding ...'; \
    Expand-Archive ojdkbuild.zip -DestinationPath C:\; \
    \
    Write-Host 'Renaming ...'; \
    Move-Item \
        -Path ('C:\{0}' -f ($env:JAVA_OJDKBUILD_ZIP -Replace '.zip$', '')) \
        -Destination $env:JAVA_HOME \
    ; \
    \
    Write-Host 'Verifying install ...'; \
    Write-Host '  java -version'; java -version; \
    Write-Host '  javac -version'; javac -version; \
    \
    Write-Host 'Removing ...'; \
    Remove-Item ojdkbuild.zip -Force; \
    \
    Write-Host 'Complete.';

#CMD ["java","-version"]


# Install jmeter
RUN   mkdir C:\jmeter

RUN cd /jmeter
RUN powershell.exe Invoke-WebRequest -usebasicparsing http://ftp.ps.pl/pub/apache/jmeter/binaries/apache-jmeter-3.1.zip -OutFile c:/apache-jmeter-3.1.zip
RUN powershell.exe Expand-Archive -Path C:\apache-jmeter-3.1.zip -DestinationPath C:/jmeter
#RUN mkdir C:/jmeter/apache-jmeter-2.13/apache-jmeter-3.1/jmeter-plugins
#RUN cd C:/jmeter/apache-jmeter-2.13/apache-jmeter-3.1/jmeter-plugins
#RUN Invoke-WebRequest -usebasicparsing  https://jmeter-#plugins.org/downloads/file/JMeterPlugins-ExtrasLibs-1.4.0.zip
#RUN Expand-Archive -Path C:/jmeter/apache-jmeter-2.13/apache-jmeter-#3.1/jmeter-plugins -DestinationPath  C:/jmeter/apache-jmeter-2.13/apache-#jmeter-3.1/jmeter-plugins

# Set Jmeter Home
ENV JMETER_HOME C:/jmeter/apache-jmeter-3.1

# Add Jmeter to the Path
ENV PATH $JMETER_HOME/bin:$PATH

COPY nature.jmx C:\\jmeter\\apache-jmeter-3.1\\bin\\nature.jmx

WORKDIR C:\\jmeter\\apache-jmeter-3.1\\bin

RUN jmeter -n -t nature.jmx -l nature.jtl
Community
  • 1
  • 1
syndy1989
  • 403
  • 10
  • 25
  • Can you show your `Dockerfile`? – vins Jul 24 '17 at 14:27
  • I have edited the post. Please find my dockerfile in the updated post – syndy1989 Jul 24 '17 at 18:06
  • Not something I have done before personally but, this [link](https://github.com/docker/for-win/issues/2679) suggests that the error could be from syntax. Double-check your usage of / and \ characters. – w4dd325 Oct 21 '21 at 13:57

0 Answers0