jenkinsci / jenkinsci/docker-workflow-plugin

[JENKINS-38438] image.inside { ... } does not create full configured user account

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

Description

The inside command shares the underlying filesystem with wokspace running docker run with --user option so the started processes inside are likely owned by the same uid/gid as their working directory. This causes problems to system tools that do not expect to run with uid/gid that does not exists in the system and its environment is no fully configured. This causes hard to debug failures as few tool expect that current user can not be looked up in /etc/passwd or the process do not have HOME variable set. Reportedly, it is not even POSIX compliant.

It does not take long to find a container/tool combination that will blow up with artificial uid/gid:

```
$ docker run -i fedora dnf update
... # OK
$ docker run -u 4242:4242 -i fedora dnf update
Traceback (most recent call last):
File "/usr/bin/dnf", line 36, in
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
errcode = main(args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
return _main(base, args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 115, in _main
cli.configure(map(ucd, args))
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 932, in configure
self.read_conf_file(opts.conffile, root, releasever, overrides)
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1043, in read_conf_file
conf.prepend_installroot(opt)
File "/usr/lib/python2.7/site-packages/dnf/yum/config.py", line 718, in prepend_installroot
path = path.lstrip('/')
AttributeError: 'NoneType' object has no attribute 'lstrip'

```

The message does not indicate the real cause at all.

---
Originally reported by olivergondza, imported from: image.inside { ... } does not create full configured user account


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

Raw content of original issue

The inside command shares the underlying filesystem with wokspace running docker run with --user option so the started processes inside are likely owned by the same uid/gid as their working directory. This causes problems to system tools that do not expect to run with uid/gid that does not exists in the system and its environment is no fully configured. This causes hard to debug failures as few tool expect that current user can not be looked up in /etc/passwd or the process do not have HOME variable set. Reportedly, it is not even POSIX compliant.

It does not take long to find a container/tool combination that will blow up with artificial uid/gid:


$ docker run -i fedora dnf update

... # OK
$ docker run -u 4242:4242 -i fedora dnf update
Traceback (most recent call last):
File "/usr/bin/dnf", line 36, in <module>
main.user_main(sys.argv[1:], exit_code=True)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 185, in user_main
errcode = main(args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
return _main(base, args)
File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 115, in _main
cli.configure(map(ucd, args))
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 932, in configure
self.read_conf_file(opts.conffile, root, releasever, overrides)
File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1043, in read_conf_file
conf.prepend_installroot(opt)
File "/usr/lib/python2.7/site-packages/dnf/yum/config.py", line 718, in prepend_installroot
path = path.lstrip('/')
AttributeError: 'NoneType' object has no attribute 'lstrip'

The message does not indicate the real cause at all.

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.