Tar can not change ownership

I’m trying to install OCaml’s llvm module with opam. The install fails when opam tries to un-tar llvm with this error for every file in the archive:
/bin/tar: llvm-3.8.0.src/<all-files>: Cannot change ownership to uid 107418, gid 5000: Invalid argument

For my environment, I’m using ubuntu:latest as my source Docker image.

To verify that its an issue with CircleCI’s environment, I can perform the same install cleanly on the same Docker image locally.

I suspect that the issue is because there’s no uid 107418. So I tried to debug this further by creating a new user, by ssh’ing into a CircleCI container, and manually create the user. This failed with: chown 107418:107418 /home/opam: Invalid argument

I can successfully un-tar the archive manually by adding --no-same-owner to the tar command. Because this is being run by a package manager I can’t edit this by hand. Is there a workaround to this problem?