Skip to content

Conversation

kkimurak
Copy link
Contributor

@kkimurak kkimurak commented Feb 22, 2023

assets/build/config/database.yml.postgresql is owned by root:root, and permission is rwxrw----
so the user git (${GILTAB_USER}) doesn't have a permission to copy the file.
This raises an permission error while building image locally if the docker is running on rootless environment (or the user is just a member of docker group).

This PR avoids this kind of issue by first copying the file as root and then changing the owner to the GITLAB_USER.

@kkimurak kkimurak force-pushed the fix-permission-error-on-copying-database.yml-for-building-image branch from ab694c8 to b1301c1 Compare March 22, 2023 11:04
@kkimurak
Copy link
Contributor Author

rebased on current master (15.9.3)

@sachilles
Copy link
Collaborator

@kkimurak Sorry for the delay. Is the postioion you pointed out the only position that fails on rootless environments?

@kkimurak
Copy link
Contributor Author

@sachilles Yes I believe so, as far as I have been building image locally these years.
This was introduced as a temporary workaround (#2596), and as far as I know it's the only access to configuration files (that copied from host to image /etc/docker-gitlab/runtime) happening in build.sh.
Usually, these files are managed by using install_template by root user.

But I have to say "I believe so", because I don't use all the features of gitlab.

`assets/build/config/database.yml.postgresql` is owned by root:root,
and permission is rwxrw----
so the user `git` (`${GILTAB_USER}`) doesn't have a permission to copy the file.
This raises an error while building.
@kkimurak kkimurak force-pushed the fix-permission-error-on-copying-database.yml-for-building-image branch from b1301c1 to 029186d Compare April 17, 2023 07:24
@kkimurak
Copy link
Contributor Author

rebased onto 15.10.3

@sachilles sachilles merged commit b246586 into sameersbn:master Apr 21, 2023
@kkimurak kkimurak deleted the fix-permission-error-on-copying-database.yml-for-building-image branch April 21, 2023 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants