Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-38438

image.inside { ... } does not create full configured user account

XMLWordPrintable

      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.

            Unassigned Unassigned
            olivergondza Oliver Gondža
            Votes:
            11 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated: