bootc-image-builder icon indicating copy to clipboard operation
bootc-image-builder copied to clipboard

bib doesn't support user group 'admins'

Open chunfuwen opened this issue 5 months ago • 0 comments

use below command to build image with config file [root@dell-per430-17 images]# cat config.json {"blueprint": {"customizations": {"user": [{"name": "alice", "password": "bob", "groups": ["wheel", "admins"], "key": "ssh-rsa xx}

sudo podman run --rm -it --privileged --pull=newer --security-opt label=type:unconfined_t -v /var/lib/libvirt/images/output:/output -v /var/lib/libvirt/images/config.json:/config.json   -v /var/lib/containers/storage:/var/lib/containers/storage  -v /var/lib/libvirt/images/auth.json:/run/containers/0/auth.json  quay.io/centos-bootc/bootc-image-builder:latest  --type qcow2 --tls-verify=true  --config /config.json quay.io/centos-bootc/centos-bootc:stream9

and throw below error:

mount/boot-efi (org.osbuild.fat): mounting /dev/loop0p2 -> /store/tmp/buildroot-tmp-f25k4kft/mounts/boot/efi
mount/ostree.deployment (org.osbuild.ostree.deployment): Deployment root at 'ostree/deploy/default/deploy/947c0ed4b66c676a76028d6137dc1e40fefb3c70b0ebee1c1b4e20e368da5ab1.0'
useradd: group 'admins' does not exist
Traceback (most recent call last):
  File "/run/osbuild/bin/org.osbuild.users", line 145, in <module>
    r = main(args["tree"], args["options"])
  File "/run/osbuild/bin/org.osbuild.users", line 127, in main
    useradd(tree, name, uid, gid, groups, description, home, shell, password, expiredate)
  File "/run/osbuild/bin/org.osbuild.users", line 51, in useradd
    subprocess.run(["chroot", root, "useradd", *arguments, name], check=True)
  File "/usr/lib64/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['chroot', '/run/osbuild/tree', 'useradd', '--groups', 'wheel,admins', '--password', '$6$ya/k4WheW48hwozk$d67B1.n3Sb5WObyeY1ap2vz55jOcwenjGY5Rtx9jFeRv4JBTmDhbJ.kCGh3Xsa9GHKDnZTPf..YKtKhcGg98Y0', 'alice']' returned non-zero exit status 6.

As per web page https://github.com/osbuild/bootc-image-builder , it give one example with group:admins

{
  "customizations": {
    "user": [
      {
        "name": "alice",
        "password": "bob",
        "key": "ssh-rsa AAA ... [email protected]",
        "groups": [
          "wheel",
          "admins"
        ]
      }
    ]
  }
}

chunfuwen avatar Sep 02 '24 08:09 chunfuwen