When building a container, we create a user account to be able to carry out the execution under an unprivileged user. For that, we use the running process' UID/GID pair. However, that assumes the UID/GID pair is a user account (IDs >= 1000) and as such does not exist in the container a priori. That assumption is false for OSX users, however, as their UID/GID combos come with IDs <= 1000.
We need to check the IDs before using them.