The --user option doesn't seem to work in docker on windows server 2019 with linux containers

I have this Dockerfile:

FROM ubuntu:bionic

RUN mkdir /usr/custom
ADD /usr/custom
RUN chmod =rx /usr/custom/
RUN useradd -ms /bin/bash -u 1001 someusr
USER someusr
WORKDIR /home/someusr

where (it is in the same directory as Dockerfile) contains:


Build the image with:

docker image build --tag my_ubuntu_bionic:auto .

Then run it with:

docker run --rm --user=1001 my_ubuntu_bionic:auto /usr/custom/

and it displays root.

How can I run this as someusr?

Thank you