Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix using rocker for non-root containers (#50)
* Fix using rocker for non-root containers If the base image given by the user does not have root privileges, building the rockerized image will fail. Extensions seem to expect that their Dockerfile snippets are executed with root privileges. This patch injects a `USER root` instruction right after FROM base_image. For similar reasons the `user` extension has to run last, because its snippet changes the active user again and subsequent snippets from other extensions might fail. * Revert redundant reordering of extensions * Fix user extension for some special cases - A user with the same UID already exists in the container image. - A group with the same GID already exists in the container image. - A user with the same name already exists in the container image. In all those cases the existing user or group gets deleted before creating a new one. Changing the password and adding the user to the sudo group is redundant to creating /etc/sudoers.d/rocker. * Suppress mail spool/home directory not found error output of userdel * tests: Remove obsolete check in UserExtensionTest * Revert "Suppress mail spool/home directory not found error output of userdel" This reverts commit c520a4e. * Create the parent directory of the home directory before calling mkhomedir_helper The tool fails with exit code 6 if the top-level directory does not exist yet. (a39bc32231c8)root@c71fe951b480:/# getent passwd johannes johannes:x:1000006:1000:Johannes Meyer:/share/homes/johannes:/bin/bash (a39bc32231c8)root@a39bc32231c8:/# rm share -R (a39bc32231c8)root@a39bc32231c8:/# mkhomedir_helper johannes; echo $? 6 (a39bc32231c8)root@a39bc32231c8:/# mkdir share (a39bc32231c8)root@a39bc32231c8:/# mkhomedir_helper johannes; echo $? 0
- Loading branch information