最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

gitlab - Unable to run chgrp inside a docker container that mounts to an NFS - Stack Overflow

matteradmin6PV0评论

I have a gitlab server that can be started up with a docker-compose.yml file.

The gitlab server runs on a Macbook Pro computer.

There are 3 volumes inside the docker-compose.yml file.

volumes:
   - './config:/etc/gitlab'
   - './logs:/var/log/gitlab'
   - './data:/var/opt/gitlab'

Today I want to try if the volumes can be changed to an NFS of a Synology NAS.

So I type the following commands to create a mount point.

sudo mkdir /Volumes/my-backup
sudo mount -t nfs -o resvport,rw nas.mydomain:/volume1/my-backup /Volumes/my-backup

Then I change the volumes section of docker-compose.yml file to this:

volumes:
  - '/Volumes/my-backup/gitlab-mount-volume/config:/etc/gitlab'
  - '/Volumes/my-backup/gitlab-mount-volume/logs:/var/log/gitlab'
  - '/Volumes/my-backup/gitlab-mount-volume/data:/var/opt/gitlab'

/Volumes/my-backup/gitlab-mount-volume/data/ folder contains the files that are created with cp -a ./data/* /Volumes/my-backup/gitlab-mount-volume/data/ command.

-a option can preserve the owner, group, and permissions of all the copied files.

Then I see the following error messages after running docker compose up command

gitlab-service-web-1  | ---- Begin output of chgrp git /var/opt/gitlab/git-data/repositories ----
gitlab-service-web-1  | STDOUT:
gitlab-service-web-1  | STDERR: chgrp: changing group of '/var/opt/gitlab/git-data/repositories': Operation not permitted
gitlab-service-web-1  | ---- End output of chgrp git /var/opt/gitlab/git-data/repositories ----
gitlab-service-web-1  | Ran chgrp git /var/opt/gitlab/git-data/repositories returned 1

Why does chgrp command generates an Operation not permitted error inside the docker container?

I've run cat /etc/export command to check that the mount point contains no_root_squash option.

192.168.123.123(rw,async,no_wdelay,crossmnt,insecure,no_root_squash,insecure_locks,sec=sys,anonuid=1025,anongid=100)
Post a comment

comment list (0)

  1. No comments so far