Incorrect owner on volume inside bind mount #47722
Labels
kind/enhancement
Enhancements are not bugs or new features but can improve usability or performance.
kind/question
status/0-triage
Description
I use a docker-compose file:
and a Dockerfile:
When the docker compose is up, two new folder(modules, uploads) will be created on host (not inside docker) with root:root permission, which is not expected. And inside docker, modules will have node:node permission, and uploads will have root:root permission.
And when I change owner inside container with
docker compose exec -u root node chown node:node -R uploads
, the owner on the host will not change, and the owner in container changed correctly.note: the node:latest image will create a user node(1000:1000) by default. My host user(corporal) is also 1000:1000
Reproduce
Expected behavior
The folders on host should be created with 1000:1000 permission
docker version
Client: Version: 25.0.4 API version: 1.44 Go version: go1.22.1 Git commit: 1a576c50a9 Built: Sat Mar 23 06:16:47 2024 OS/Arch: linux/amd64 Context: default Server: Engine: Version: 25.0.4 API version: 1.44 (minimum version 1.24) Go version: go1.22.1 Git commit: 061aa95809be396a6b5542618d8a34b02a21ff77 Built: Sun Mar 24 05:32:47 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.7.14 GitCommit: dcf2847247e18caba8dce86522029642f60fe96b runc: Version: 1.1.12 GitCommit: 51d5e94601ceffbbd85688df1c928ecccbfa4685 docker-init: Version: 0.19.0 GitCommit: de40ad007797e0dcd8b7126f27bb87401d224240
docker info
Additional Info
I wonder if this can be set in someway, or are there any workaround? Thanks in advance!
The text was updated successfully, but these errors were encountered: