Skip to content

Commit

Permalink
[Jenkins] Get gid of file instead of group
Browse files Browse the repository at this point in the history
/var/run/docker.sock may not be owned by the docker group in this docker
image due to the gid on the host being different. So instead, get the
gid by using stat on the file and add those permissions in the inside
image.
  • Loading branch information
sjoelund committed Nov 2, 2018
1 parent df7ca86 commit c6488e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Jenkinsfile
Expand Up @@ -129,7 +129,7 @@ pipeline {
script {
def deps = docker.build('testsuite-fmu-crosscompile', '--pull .CI/cache')
// deps.pull() // Already built...
def dockergid = sh (script: 'getent group docker | cut -d: -f3', returnStdout: true).trim()
def dockergid = sh (script: 'stat -c %g /var/run/docker.sock', returnStdout: true).trim()
deps.inside("-v /var/run/docker.sock:/var/run/docker.sock --group-add '${dockergid}'") {
standardSetup()
unstash 'omc-clang'
Expand Down

0 comments on commit c6488e5

Please sign in to comment.