Build the Dockerfile:
FROM ubuntu
RUN useradd alice
RUN mkdir -p /src && chown alice /src && chmod u+rwx /src
USER alice
WORKDIR /src
RUN stat /src && exit 1
Expected:
Stat should print that the owner of /src is "alice"
From docker build .:
Access: (0755/drwxr-xr-x) Uid: ( 1000/ alice) Gid: ( 0/ root)
Actual:
Stat prints that the owner of /src is "root":
From buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=.
#7 0.216 Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Tested with buildkit daemon moby/buildkit:latest
Build the Dockerfile:
Expected:
Stat should print that the owner of /src is "alice"
From
docker build .:Actual:
Stat prints that the owner of /src is "root":
From
buildctl build --frontend=dockerfile.v0 --local context=. --local dockerfile=.Tested with buildkit daemon
moby/buildkit:latest