Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change permissions inside a volumed folder on ReFS drive #13877

Open
PAXANDDOS opened this issue Jan 17, 2024 · 5 comments
Open

Unable to change permissions inside a volumed folder on ReFS drive #13877

PAXANDDOS opened this issue Jan 17, 2024 · 5 comments

Comments

@PAXANDDOS
Copy link

PAXANDDOS commented Jan 17, 2024

Description

I'm using a ReFS drive for development purposes (so-called Dev Drive) and so far the only issue I'm having is with file/folder permissions. I was working on an NTFS drive before and haven't changed anything in the project since then. I have a whole working directory volumed like that:

volumes:
  - ./:/var/www/html:rw

But inside the container, every file and folder would have root ownership instead of www-data (set in dockerfile). All my attempts to change that would literally do nothing. For example, chown -R www-data:www-data . would take a while; after that, all files will remain with root ownership. That causes the application to fail trying to do something to the filesystem.

Might be worth noting that I also have Disk image location (Docker Desktop -> Settings -> Resources) set to a folder on the same ReFS drive.

Reproduce

  1. Setup project on a ReFS drive (Dev Drive)
  2. Minimal Dockerfile (you must have few files for testing)
FROM alpine:3.19

WORKDIR /var/www/html

COPY --chown=www-data:www-data . .
  1. Minimal compose.yml
services:
  test:
    image: test
    tty: true
    build:
      context: .
    volumes:
      - .:/var/www/html
  1. Start with docker compose up -d
  2. Attach with docker compose exec test sh
  3. See that all permissions are set to root instead of www-data with ls -la
  4. Try to chown and see that nothing changes

Expected behavior

Files and folder have www-data ownership

docker version

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:08:44 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.26.1 (131620)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:02 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.25
  GitCommit:        d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc:
  Version:          1.1.10
  GitCommit:        v1.1.10-0-g18a0cb0
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    24.0.7
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.12.0-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.3-desktop.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.21
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  0.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.10
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.2.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 5
  Running: 5
  Paused: 0
  Stopped: 0
 Images: 7
 Server Version: 24.0.7
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d8f198a4ed8892c764191ef7b3b06d8a2eeb5c7f
 runc version: v1.1.10-0-g18a0cb0
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 15.58GiB
 Name: docker-desktop
 ID: 84f16ccc-31dd-49ff-9c26-e5795ffeabde
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

1F906053-8E46-4ABD-97BC-48F533E190A9/20240117164604

Additional Info

Windows 11 Pro 64-bit (10.0, Build 22631) (22621.ni_release.220506-1250)
AMD Ryzen 7 5800X3D
32GB RAM

@PAXANDDOS
Copy link
Author

I need to clear this out too. I was only mounting my working directory so the host and the container would always be in sync. Today I found out that docker compose watch was recently released and it's a great tool for me (not perfect though 😅). That means I no longer have this issue because I'm no longer mounting my working directory.

But still, the issue itself doesn't seem right, chown should change the owner just like it does on NTFS drive.

@nesherhh
Copy link

Having same issue. All files are on ReFS drive. Trying to start PostgreSQL inside docker compose gives this error message:

chmod: changing permissions of '/var/lib/postgresql/data': Operation not permitted
initdb: error: could not change permissions of directory "/var/lib/postgresql/data": Operation not permitted

@spartanhooah
Copy link

I'm running into the same issue. I've tried modifying the permissions of the directory both in Windows and in WSL but nothing seems to help.

@engeld
Copy link

engeld commented Nov 13, 2024

I'm having the same issue and can reproduce it with the steps provided from @PAXANDDOS as well. Is there any news on this?

@engeld
Copy link

engeld commented Nov 13, 2024

Also, not sure it's really related to microsoft/WSL#10792 - or did it fix the issue for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants