Setting build args for dockerfile agent using a Jenkins declarative pipeline

前端 未结 5 1210
名媛妹妹
名媛妹妹 2020-12-31 00:56

I\'m using the declarative pipeline syntax to do some CI work inside a docker container.

I\'ve noticed that the Docker plugin for Jenkins runs a container using the

5条回答
  •  悲哀的现实
    2020-12-31 01:34

    You can also add a block like this:

    agent {
        dockerfile {
    
            args '-v /etc/passwd:/etc/passwd -v /etc/group:/etc/group'
        }
    }
    

    That will allow the container to have the correct user and group ID.

提交回复
热议问题