Environment:
- docker-plugin version: 1.1.2;
- jenkins version: 2.0.50727;
- docker client/server version: 17.12.0-ce;
- Win 10 Pro x64;
Scenario 1: I try to run the Selenoid image via Jenkinsfile with the following command:
stage('Start services') {
docker.image('aerokube/selenoid').
run('--name selenoid ' +
'-p 4444:4444 ' +
'-v C:/workspace/selenoid:/etc/selenoid ' +
'-v C:/workspace/output:/opt/selenoid/video ' +
'-v //var/run/docker.sock:/var/run/docker.sock ' +
'-e "OVERRIDE_VIDEO_OUTPUT_DIR=/C/workspace/output/"')
}
Actual result: The container is created and I see the Selenoid container in the docker ps output.
Scenario 2:
When I add any command after a point - container doesn't create. Please see the following:
stage('Start services') {
docker.image('aerokube/selenoid').
run('--name selenoid ' +
'-p 4444:4444 ' +
'-v C:/workspace/selenoid:/etc/selenoid ' +
'-v C:/workspace/output:/opt/selenoid/video ' +
'-v //var/run/docker.sock:/var/run/docker.sock ' +
'-e "OVERRIDE_VIDEO_OUTPUT_DIR=/C/workspace/output/"',
'-video-output-dir /output')
}
In this scenario, I added -video-output-dir /output
.
BTW I try to add next command after a point:
-limit 10
, -conf /etc/selenoid/browsers.json
-> but still to no avail.
Also, please see the following logs from Jenkins job:
[Pipeline] sh
[C:\Jenkins\workspace\pplication_react-app_master-6UL22J3ZHJJMMTIKZO5LDRETFMNMM4TSEGGCZJKAGTM5HBOEAEYQ] Running shell script
+ docker run -d --name selenoid -p 4444:4444 -v C:/workspace/selenoid:/etc/selenoid -v C:/workspace/output:/opt/selenoid/video -v //var/run/docker.sock:/var/run/docker.sock -e OVERRIDE_VIDEO_OUTPUT_DIR=/C/workspace/output/ aerokube/selenoid -video-output-dir /output
[Pipeline] dockerFingerprintRun
[Pipeline] bat
[pplication_react-app_master-6UL22J3ZHJJMMTIKZO5LDRETFMNMM4TSEGGCZJKAGTM5HBOEAEYQ] Running batch script
C:\Jenkins\workspace\pplication_react-app_master-6UL22J3ZHJJMMTIKZO5LDRETFMNMM4TSEGGCZJKAGTM5HBOEAEYQ>docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Docker ps
command output is empty...
What I'm doing wrong? Maybe I'm so not doing args
transfer into the run() section?