Skip to content

Fix 'detected dubious ownership in repository' error in Docker build and run process #4645

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShotaroMuraoka
Copy link

This pull request solves the problem fatal: detected dubious ownership in repository at ... when executing the make command. This was solved by passing the UID and GID of the host user as build arguments and adjusting the ownership of the cloned repository in the Dockerfile.

Steps to reproduce

Precondition: Ensure that the doc-base and phd repositories are not cloned in directories adjacent to this directory.
Run the following command in the project root directory:

make

This will trigger the Docker build and run process, which previously resulted in the "detected dubious ownership in repository" error.

Changes

  • Added UID and GID build arguments in the Makefile docker build command.
  • Modified Dockerfile to use these arguments and change ownership of /var/www/phd and /var/www/doc-base directories.

Verification

  • Confirmed that make completes successfully without the dubious ownership error.
  • Verified that the container runs correctly and updates repositories as expected.

Note to reviewers

I'm new to contributing to this repo, so please bear with me.
If you have any feedback or suggestions, I'd really appreciate it!

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.

1 participant