To run a container with uid:123 and gid:123, I've tried running a container using the following command:
ctr run --rm --uidmap 123:123:999 --gidmap 123:123:999 docker.io/library/test:1.0 test
However, I had the following error and the container couldn't start.
ctr: failed to create shim task: OCI runtime create failed: runc create failed: User namespaces enabled, but no user mapping found.: unknow
If I run the container without gidmap setting (specifying --uidmap only), it starts but as a root.
I believe my docker image is correct as I can run it with nerdctl and it runs as the user 123:
nerdctl run -it --rm -u 123:123 test:1.0
Does anyone know the solution?