When trying to build a docker image with a large value of UID, such as 1000123456, docker build repeatedly hangs on the line with RUN useradd.
To reproduce:
$ touch Dockerfile
$ echo FROM ubuntu:latest >> Dockerfile
$ echo RUN useradd -m -s /bin/bash -N -u 1000123456 jovyan >> Dockerfile
$ docker build --tag mirekphd/test-uid .
Sending build context to Docker daemon 2.048kB
Step 1/2 : FROM ubuntu:latest
---> d2e4e1f51132
Step 2/2 : RUN useradd -m -s /bin/bash -N -u 1000123456 jovyan
---> Running in 04707e01aefc
Any known solutions (to accept) or at least workarounds (to upvote)?
More info
This bug can manifest itself for example when trying to hard-code (for debug only) a UID within the range of values accepted by one of Openshift/OKD namespaces.
As a side-effect of this issue, the build takes up huge amount of disk space (any proposed workarounds should be free of this side-effect):
$ docker system prune -f
Deleted Containers:
04707e01aefcda9ce9840389f1d59821e1ddb7dac535d416f99447e657ec5309
c3fc96209790ee7aa0c2c10bec2459e8ec3dbcc1dc7cfdd0a3e12960a28b9437
1ed4985b3e27eaff6394fd0243713573473ab59c9a82db865e40ebb40a391892
Total reclaimed space: 648.1GB