pipeline {
agent {
docker {
image ‘dummy_image:latest’
args "-u root:root "
}
}
stages {
stage('stage') {
steps {
script {
sh'''
id
'''
dir("${WORKSPACE}")
{
checkout scmGit(branches: [[name: '*/main']], extensions: [], userRemoteConfigs: [[credentialsId: 'douglas_id', url: 'giturl']])
}
}
}
here is my pipeline that uses docker agent, when I run the pipeline,
the generated docker run command is
docker run -t -d -u 9110:100 -u root:root dummy_image:latest cat
id in the pipeline shows user info for root which means root uses logs in the docker container
but after checkout command is run, the owner of the downloaded git project files is user 9110, it is so strange, why is not their owner root?
how to disable -u 9110:100, I do not want this user to login docker container