I have Jenkins installed in Docker container by the following guideline https://www.jenkins.io/doc/book/installing/docker/
I am also trying to install Selenoid image in Jenkins using the pipeline
pipeline {
agent any
stages {
stage('Prepare Selenoid') {
steps {
sh 'wget "https://github.com/aerokube/cm/releases/download/1.8.2/cm_linux_amd64"'
sh 'chmod +x cm_linux_amd64'
sh './cm_linux_amd64 selenoid start –vnc'
sh 'docker ps'
sh 'docker logs selenoid'
sh 'curl http://localhost:4444/status'
}
}
}
post {
always {
script {
sh 'docker stop selenoid'
sh 'docker rm selenoid'
}
}
}
}
When I run this job, I got the following logs:
...
> Starting Selenoid...
> Successfully started Selenoid
+ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
99467c57d5c6 aerokube/selenoid:1.10.9 "/usr/bin/selenoid -…" 2 seconds ago Up Less than a second 0.0.0.0:4444->4444/tcp selenoid
+ docker logs selenoid
2023/01/13 17:09:45 [-] [INIT] [Loading configuration files...]
2023/01/13 17:09:45 [-] [INIT] [Loaded configuration from /etc/selenoid/browsers.json]
2023/01/13 17:09:45 [-] [INIT] [Video Dir: /opt/selenoid/video]
2023/01/13 17:09:45 [-] [INIT] [Logs Dir: /opt/selenoid/logs]
2023/01/13 17:09:45 [-] [INIT] [Using Docker API version: 1.41]
2023/01/13 17:09:45 [-] [INIT] [Timezone: UTC]
2023/01/13 17:09:45 [-] [INIT] [Listening on :4444]
+ curl http://localhost:4444/status
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to localhost port 4444: Connection refused
script returned exit code 7+
...
I also tried different options: 0.0.0.0:4444/status 127.0.0.1:4444/status