I want my docker to run in this way
docker run -d -it --privileged <docker_img_name> /usr/sbin/init 456547fa74aa4b302d8b6f5679a6a079caf0e123654ecd5cda7b3587aa9e225d
docker exec -it 456547fa7 bash
pipeline {
agent {
kubernetes {
label "Docker"
inheritFrom 'rootless'
defaultContainer 'dind'
yaml container([[ name: 'buildimg', image: "<docker_image_name>"]])
}
}
options {
timeout(time: 180, unit: 'MINUTES')
buildDiscarder(logRotator(daysToKeepStr: '30', artifactDaysToKeepStr: '30'))
timestamps()
}
environment {
IMG_SRC="somesrc.com"
IMG_NAME="someimg.qcow2"
}
stages{
stage('Fetch_image_list') {
steps {
container('buildimg') {
sh'''
echo "INFO : Some Stages"
'''
}
}
}
}
How to run Jenkins with Docker on Kubernetes? Referred to this but still didn't get it. Sorry I'm too new to Jenkins, Docker & Kubernetes in general. I'm in my second month of internship... Please help.