While testing out the 0.8.1 rootless image, I encountered the following build error:
error: failed to solve: rpc error: code = Unknown desc = open /.docker/.token_seed: permission denied
From looking at the source code it appears that the token seed file logic is only checking against syscall.EPERM and not syscall.EACCES, so a permission failure is fatal. You should switch to os.IsPermission(err) instead of using errors.Is(err, syscall.EPERM), since this will account for both syscall.EPERM and syscall.EACCES.
Thanks for the report. How did you hit this?
In my Dockerfile, the /.docker folder was created by root. (It was really created as a side effect of a COPY instruction, which ignores the contextual uid/gid, unlike RUN.) Consequently, uid 1000 did not have write permission to the folder, so attempting to create the /.docker/.token_seed file failed.
I had the same error, though for me this occurs when accessing an image directly from docker hub using 'FROM ...'. Not sure it has anything to do with this, and the error disappears after i manually run a 'docker pull ...'. It is not limited to the image used here (alpine) but for everything. Is this happening for anybody else? I am on macOS Big Sur if that matters.
I got same error.
For now docker pull ... helped but I'm not sure yet if error is gone for good.
Most helpful comment
I had the same error, though for me this occurs when accessing an image directly from docker hub using 'FROM ...'. Not sure it has anything to do with this, and the error disappears after i manually run a 'docker pull ...'. It is not limited to the image used here (alpine) but for everything. Is this happening for anybody else? I am on macOS Big Sur if that matters.