jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-46666] Permission issue using Docker as build environment

Open
#518 1 comment 0 reactions 0 assignees View on GitHub
component:docker-workflow-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
527
Forks
422
Avg merge
10m
Merged PRs (30d)
1

Description

I installed Jenkins on an Ubuntu 16.04 machine. The Jenkins itself is not run in a container. What I want to do is simply call `yarn install` using a node image. So here is my Jenkinsfile:

pipeline {

agent any
stages {
stage('install node modules...') {
agent { docker 'node' }
steps {
sh 'cd /path/to/package.json; yarn install'
}
}
}
}

Pretty straightforward, right?

jenkins user/group is 112:116, and the uid of the node container is 1000, hence yarn process (which is run as node user 1000) can't do its things, like `mkdir /.config`.

I tried to spin up the node container passing in argument `-u 1000`, it bumped into permission issues when trying to create durable directories.

It looks like one or the other kind of issue, how can I work around that?

---
Originally reported by michaelonline, imported from: Permission issue using Docker as build environment


  • status: Open
  • priority: Major
  • component(s): docker-workflow-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 2
  • imported: 2025-12-07

Raw content of original issue

I installed Jenkins on an Ubuntu 16.04 machine. The Jenkins itself is not run in a container. What I want to do is simply call `yarn install` using a node image. So here is my Jenkinsfile:



pipeline {

agent any
stages {
stage('install node modules...') {
agent { docker 'node' }
steps {
sh 'cd /path/to/package.json; yarn install'
}
}
}
}


Pretty straightforward, right?

jenkins user/group is 112:116, and the uid of the node container is 1000, hence yarn process (which is run as node user 1000) can't do its things, like `mkdir /.config`.

I tried to spin up the node container passing in argument `-u 1000`, it bumped into permission issues when trying to create durable directories.

It looks like one or the other kind of issue, how can I work around that?

  • environment: Jenkins ver. 2.60.3, with default suggested plugins

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.