dir_create can't set permission from docker
When creating a new directory using `fs::dir_create` from docker using this simple docker file:
```docker
FROM rocker/r-ver:4.5.1
RUN Rscript -e "if (!requireNamespace('fs', quietly = TRUE)) install.packages('fs', repos='https://cloud.r-project.org')"
VOLUME /data
CMD ["Rscript", "-e", "fs::dir_create('/data/fs-dir')"]
```
build with:
```bash
docker build -t dir-maker .
```
and run:
```bash
docker run --rm \
-v ~/<PATH>:/data:rw \
dir-maker
```
I get this error:
```
Error: [EACCES] Failed to set permissions for directory '/data/fs-dir': permission denied
Execution halted
```
The new directory is actually created, but with permissions `r-xr--r-x`.
I thought that it was related to the permission settings for Docker on macos, but now I'm leaning towards this actually being an `fs` issue.
If I create a new directory using `base::dir.create()` the directory is created (`rwxr-xr-x`) without error (same docker build and run commands).
```docker
FROM rocker/r-ver:4.5.1
VOLUME /data
CMD ["Rscript", "-e", "dir.create('/data/base-dir')"]
```
Possibly related to https://github.com/r-lib/fs/issues/465 and https://github.com/r-lib/fs/issues/293
```
─ Session info ────────────────────────────────────────────────────────
setting value
version R version 4.5.1 (2025-06-13)
os macOS Sequoia 15.5
system aarch64, darwin20
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Copenhagen
date 2025-07-07
pandoc NA
quarto 1.6.40 @ /usr/local/bin/quarto
fs 1.6.6 2025-04-12 [1] CRAN (R 4.5.0)
Docker version 28.2.2, build e6534b4
```
0 条评论