@@ -327,12 +327,17 @@ async function installRequirements(targetFolder, pluginInstance) {
327
327
}
328
328
// Install requirements with pip
329
329
// Set the ownership of the current folder to user
330
- pipCmds . push ( [
331
- 'chown' ,
332
- '-R' ,
333
- `${ process . getuid ( ) } :${ process . getgid ( ) } ` ,
334
- '/var/task' ,
335
- ] ) ;
330
+ // If you use docker-rootless, you don't need to set the ownership
331
+ if ( options . dockerRootless !== true ) {
332
+ pipCmds . push ( [
333
+ 'chown' ,
334
+ '-R' ,
335
+ `${ process . getuid ( ) } :${ process . getgid ( ) } ` ,
336
+ '/var/task' ,
337
+ ] ) ;
338
+ } else {
339
+ pipCmds . push ( [ 'chown' , '-R' , '0:0' , '/var/task' ] ) ;
340
+ }
336
341
} else {
337
342
// Use same user so --cache-dir works
338
343
dockerCmd . push ( '-u' , await getDockerUid ( bindPath , pluginInstance ) ) ;
@@ -345,12 +350,16 @@ async function installRequirements(targetFolder, pluginInstance) {
345
350
if ( process . platform === 'linux' ) {
346
351
if ( options . useDownloadCache ) {
347
352
// Set the ownership of the download cache dir back to user
348
- pipCmds . push ( [
349
- 'chown' ,
350
- '-R' ,
351
- `${ process . getuid ( ) } :${ process . getgid ( ) } ` ,
352
- dockerDownloadCacheDir ,
353
- ] ) ;
353
+ if ( options . dockerRootless !== true ) {
354
+ pipCmds . push ( [
355
+ 'chown' ,
356
+ '-R' ,
357
+ `${ process . getuid ( ) } :${ process . getgid ( ) } ` ,
358
+ dockerDownloadCacheDir ,
359
+ ] ) ;
360
+ } else {
361
+ pipCmds . push ( [ 'chown' , '-R' , '0:0' , dockerDownloadCacheDir ] ) ;
362
+ }
354
363
}
355
364
}
356
365
0 commit comments