While running the gitlab-ce docker container with no-root user and mounted home volume, the container started failed.

Summary

While running the gitlab-ce docker container with no-root user and mounted home volume, the container started failed.

Steps to reproduce

environment:
CentOS Linux release 7.5.1804 (Core)
Current version: gitlab-ce=11.3.4-ce.0

script:
docker image pull gitlab/gitlab-ce
docker run -e "TZ=Asia/Taipei" -v gitlab_host_backup:gitlab_container_backup --detach --restart always --publish $gitlab_port:80 --name $gitlab_container_name --user user_uid:user_gid gitlab/gitlab-ce

Where the user is a no-root user with sudo privilege in the host os. The username is rd.
The $gitlab_host_backup is /home/rd/storage/gitlab/backup.
The $gitlab_container_backup is /var/opt/gitlab/backups.

What is the current bug behavior?

When I run the container, it soon failed and restart. I used the docker logs command and found the following message.

Installing gitlab.rb config...
cp: cannot create regular file '/etc/gitlab/gitlab.rb': Permission denied

What is the expected correct behavior?

It must be started normally.

Edited by s9256001