Katalon Studio in Docker (docker: invalid reference..)

Hello,

I’m new to docker but I have docker for desktop running on Mac. A Katalan Studio project example named “TestProject” and the following “run_chrome.sh” and/or “run_firefox.sh” scripts. My bash/sh path set.

#!/bin/sh

set -xe

rm -rfv ./reports/chrome
mkdir -p ./reports/chrome

docker run -t --rm -v "$(pwd)"/TestProject:/katalon/katalon/source "$(pwd)"/reports/chrome:/katalon/katalon/report katalonstudio/katalon katalon-execute.sh -browserType="Firefox" -retry=0 -statusDelay=15 -testSuitePath="Test Suites/TestProjectAll"

Now when I run these scripts I get the following error:

docker: invalid reference format: repository name must be lowercase

I have attempted to place the project outside Katalon Studio/ (to avoid folder with space) and I have attempted to rename the project folder to lowercase and project name in script.

I understand this is a docker thing but any reply/fix would be very helpful


seem to me this is problem docker thinks that you are setting repository there … try to remove “:”
see below : is used to choose version of image in repo…
docker run
<—cut—>
katalonstudio/katalon:6.3.1 /bin/bash -c "cp /tmp/katalon_execute/project/MyVault/cacerts /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/ && katalon-execute.sh
<—cut—>

nope. the “:” are corect, are also used in bind mount syntax, e.g:

-v "$(pwd)"/TestProject:/katalon/katalon/source

will mount the folder TestProject from the current path in /katalon/katalon/source inside the container.

see for reference: https://docs.docker.com/storage/bind-mounts/

@tonyclemmey you are missing a second “-v” for the report folder binding, should be:

-v "$(pwd)"/reports/chrome:/katalon/katalon/report
2 Likes

you are right …

Thanks @bionel

So now I have the following command:

#!/bin/sh

set -xe

rm -rfv ./reports/chrome
mkdir -p ./reports/chrome

docker run -t --rm -v “$(pwd)”/TestProject:/katalon/katalon/source -v “$(pwd)”/reports/chrome:/katalon/katalon/report katalonstudio/katalon katalon-execute.sh -browserType=“Chrome” -retry=0 -statusDelay=15 -testSuitePath=“Test Suites/TestProjectAll” -reportFolder=“reports/chrome” -reportFileName=“testreport” -runMode=console

But when I run I get this:

$ ./file.sh

  • rm -rfv ./reports/chrome
    ./reports/chrome
  • mkdir -p ./reports/chrome
    ++ pwd
    ++ pwd
  • docker run -t --rm -v ‘/Users/tony/Katalon Studio/TestProject/testproject:/katalon/katalon/source’ -v ‘/Users/tony/Katalon Studio/TestProject/reports/chrome:/katalon/katalon/report’ katalonstudio/katalon katalon-execute.sh -browserType=Chrome -retry=0 -statusDelay=15 ‘-testSuitePath=Test Suites/TestProjectAll’ -reportFolder=reports/chrome -reportFileName=testreport
  • echo ‘Starting Katalon Studio’
    Starting Katalon Studio
  • cat /katalon/version
    Google Chrome 77.0.3865.120
    Mozilla Firefox 69.0.2
    Katalon Studio 7.1.2
    ++ pwd
  • current_dir=/
  • workspace_dir=/tmp/katalon_execute/workspace
  • mkdir -p /tmp/katalon_execute/workspace
  • chmod -R 777 /tmp/katalon_execute/workspace
  • source_dir=/katalon/katalon/source
  • ‘[’ -d /katalon/katalon/source ‘]’
  • project_dir=/tmp/katalon_execute/project
  • mkdir -p /tmp/katalon_execute/project
  • cp -r /katalon/katalon/source/report /tmp/katalon_execute/project
    ++ find /tmp/katalon_execute/project -name ‘*.prj’
  • project_prj_file=
  • cd /tmp/katalon_execute/project
  • ‘[’ -f /tmp/katalon_execute/project/build.gradle ‘]’
  • cd /
  • touch /tmp/katalon_execute/project/.classpath
  • chmod -R 777 /tmp/katalon_execute/project
  • rm -rf /tmp/katalon_execute/project/bin
  • rm -rf /tmp/katalon_execute/project/Libs
  • ls -la /tmp/katalon_execute/project
    total 12
    drwxrwxrwx 3 root root 4096 Jan 6 13:54 .
    drwxr-xr-x 4 root root 4096 Jan 6 13:54 …
    -rwxrwxrwx 1 root root 0 Jan 6 13:54 .classpath
    drwxrwxrwx 2 root root 4096 Jan 6 13:54 report
  • report_dir=/katalon/katalon/report
  • ‘[’ -d /katalon/katalon/report ‘]’
  • mkdir -p /katalon/katalon/report
  • args=("$KATALON_KATALON_INSTALL_DIR/katalonc" “$@”)
  • args+=("-runMode=console")
  • args+=("-reportFolder=$report_dir")
  • args+=("-projectPath=$project_prj_file")
  • cd /tmp/katalon_execute/workspace
  • xvfb-run -s ‘-screen 0 1024x768x24’ /opt/katalonstudio/katalonc -browserType=Chrome -retry=0 -statusDelay=15 ‘-testSuitePath=Test Suites/TestProjectAll’ -reportFolder=reports/chrome -reportFileName=testreport -runMode=console -reportFolder=/katalon/katalon/report -projectPath=
    Katalon workspace folder is set to default location: /opt/katalonstudio/config/session-db61d6aa
    Starting Groovy-Eclipse compiler resolver. Specified compiler level: unspecified
    173 2.4.7.xx-201611170128-e46 = ACTIVE
    joptsimple.OptionMissingRequiredArgumentException: Option projectPath requires an argument
    at joptsimple.RequiredArgumentOptionSpec.detectOptionArgument(RequiredArgumentOptionSpec.java:48)
    at joptsimple.ArgumentAcceptingOptionSpec.handleOption(ArgumentAcceptingOptionSpec.java:257)
    at joptsimple.OptionParser.handleShortOptionToken(OptionParser.java:520)
    at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:59)
    at joptsimple.OptionParser.parse(OptionParser.java:396)
    at com.kms.katalon.execution.console.ConsoleMain.launch(ConsoleMain.java:132)
    at com.kms.katalon.console.application.Application.runConsole(Application.java:71)
    at com.kms.katalon.core.application.Application.runConsole(Application.java:98)
    at com.kms.katalon.core.application.Application.start(Application.java:73)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1492)

All launchers terminated

  • ret_code=2
    ++ id -u
    ++ id -g
  • chown -R 0:0 /katalon/katalon/report
  • chmod -R 777 /katalon/katalon/report
  • ls /katalon/katalon/report
  • cd /
  • exit 2

Any ideas whats wrong?

Seems like you forgot to specify projectPath argument.

@ThanhTo

I did try with -projectPath= and path to .prj file but still the same.

Following example at https://github.com/katalon-studio-samples/ci-samples/blob/master/run_chrome.sh

So I don’t feel its that

katalon -noSplash -runMode=console -projectPath="C:\Users\katalon\Katalon Studio\KatalonJenkinsTest\KatalonJenkinsTest.prj" -retry=0 -testSuitePath="Test Suites/Amazon" -executionProfile="default" -browserType="Chrome"

The above worked for me

Hi @Manu_Mahendran

Would you mind sharing your fully working docker command so I can also adjust mine and test?

docker run -i --rm -v “$(pwd)”:/katalon/katalon/source katalonstudio/katalon katalon-execute.sh -browserType=“Chrome” -statusDelay=15 -retry=1 -retryFailedTestCases=true -executionProfile=“default” -testSuitePath=“Test Suites/testsuite_TS” -DISPLAY_CONFIGURATION=1178X1908X24

Please be mindful about the double quotes.