Why podman build fails with the error message "useradd: /etc/passwd.1: lock file already used" while building images as non-root user on Red Hat Enterprise Linux 8 ?

Solution Verified - Updated -

Issue

  • Why rootles podman build fails with the error message "useradd: /etc/passwd.1: lock file already used" while building images on Red Hat Enterprise Linux 8 ?
STEP 1: FROM test.com/test/image:latest
STEP 2: USER 0
3abe720095db7b55e7f634062cb834048e212e3b081d3c48ecf7573f5b24b9cb
STEP 3: RUN useradd -u 1001 -G 0 mqm
useradd: /etc/passwd.1: lock file already used
useradd: cannot lock /etc/passwd; try again later.
Error: error building at STEP "RUN useradd -u 1001 -G 0 mqm": error while running runtime: exit status 1

Environment

  • Red Hat Enterprise Linux 8
  • buildah-1.11.6-4.module+el8.1.1+5259+bcdd613a.x86_64
  • podman-1.6.4-2.module+el8.1.1+5363+bf8ff1af.x86_64
  • fuse-overlayfs-0.7.2-1.module+el8.1.1+5259+bcdd613a.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content