Docker Community Forums

Share and learn in the Docker community.

RUN adduser seems to hang with large uid

Hi

I have a very short Dockerfile:

FROM ubuntu:16.04
MAINTAINER testuser

RUN adduser testuser --uid 1211600000

if I build this with docker build ., it seems to hang on the adduser line. This seems to be connected with the large uid I gave. It works if I use a short uid, I also work if I start a ubuntu:16.04 container and enter adduser inside of it.

Any suggestions on what I’m doing wrong? or what I can do to get around this bug? (I really want to use this large uid).

My current work around is to use useradd with the “–no-log-init” option:
RUN useradd testuser -l --uid 1211600000

Why do you want to use this large UUID?

I wanted the userID to match the userID calling the script. This enables keeping correct userIDs when mounting volumes inside a container. For some reason some people I know have such userIDs. It is not an option to change those.

Also there might be other solutions to map user ids, that I’m not aware of.