sh "docker tag Uptime monishdockerhub/Uptime:latest"
sh "docker push monishdockerhub/Uptime:latest"
}
}
}
}
stage("TRIVY IMAGE SCAN"){
steps{
sh "trivy image monishdockerhub/Uptime:latest > trivy.json"
}
}
stage("Remove container") {
steps{
sh "docker stop Uptime | true"
sh "docker rm Uptime | true"
}
}
stage('Deploy to Container'){
steps{
sh docker run -d --name Uptime -v /var/run/docker.sock:/var/run/docker.sock -p 3001:3001 monishdockerhub/Uptime:latest //a docker container is self-contained, which means Uptime Kuma cannot access your host. You need to bind the /var/run/docker.sock to your container.