can someone please let me know on how to pass insecure registry as an argument when using DIND image as runtime container. Please find the below sample script which i had been using as docker run time agent. '''
pipeline {
agent {label 'jenkins-docker-slave'}
stages{
stage('maven version'){
agent {docker { image 'maven:latest'}}
steps{
script{
sh "mvn --version"
}
}
}
stage('docker build'){
agent {
docker {
image 'docker:dind'
args '-v /var/run/docker.sock:/var/run/docker.sock'
}
}
steps{
script{
sh 'docker version'
}
}
}
}
}
'''
Docker version works fine but my motive is to set insecure registry as below during the runtime so that i can use docker login and docker push commands successfully.
{
"insecure-registries": [
"ec2-52-39-183-6.us-west-2.compute.amazonaws.com:8123"
]
}
I want to make the above condition work during the runtime. Can someone please advise on how this can be achived with DIND?