SmartBear / docker-soapui-testrunner

Customizable ReadyAPI Test runner docker image
6 stars 4 forks source link

Docker root user #16

Open BBvlgar opened 1 year ago

BBvlgar commented 1 year ago

Hello,

We have following problem(permission denied) when report is generated in /reports directory in the container.

17:13:27,896 INFO [WsdlProject] Loaded project from [file:/usr/local/smartbear/project/] 17:13:30,440 WARN [SoapUIProGroovyScriptEngineFactory] Missing scripts folder [/scripts] 17:13:31,508 INFO [SoapUIProTestCaseRunner] Running tests in the project [C04] 17:13:31,673 INFO [SoapUIProTestCaseRunner] Running Project [C04], runType = SEQUENTIAL 17:13:31,705 INFO [SoapUIProTestCaseRunner] Project [C04] finished with status [PASS] in 23ms 17:13:35,756 WARN [SoapUIProTestCaseRunner] Cannot access the "//reports" folder. net.sf.jasperreports.engine.JRRuntimeException: java.io.FileNotFoundException: /reports/Project Report.pdf (Permission denied)

The container now runs as default user “smartbear” Even thought the container starts with "smartbear" user it creates a /reports directory inside the container with owner root and following rights:

rwxr-xr-x root root

even if the mounted "bind mount" on the host has full rights and owner is mapped to the uid and gid to the smartbear user in container(1000:1000)

The only solution i found is to start the container with root user: Example command:

docker run -u root --rm -i --pull=always -v="/CTP/customer/C04":/project -v="/CTP/reports/C04-1699":/reports -v="/CTP/ext":/ext -v="/etc/timezone":/etc/timezone -e SLM_LICENSE_SERVER=https://api.slm.manage.smartbear.com:443 -e API_KEY= -e COMMAND_LINE="'-TTestSuite BILLING' -f/%reports% '-RJUnit-Style HTML Report' -FHTML '-EDefault environment' '/%project%/' -a" smartbear/ready-api-soapui-testrunner:3.47.0 2>&1