Skip to content
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

fatal: detected dubious ownership in repository at '/go/src/github.com/awslabs/amazon-ecr-credential-helper' #800

Closed
ktasper opened this issue May 1, 2024 · 2 comments

Comments

@ktasper
Copy link
Contributor

ktasper commented May 1, 2024

When running the following locally:

sudo -E make docker

I get the following error:

docker run --rm \
        --user 0:0 \
        --env TARGET_GOOS= \
        --env TARGET_GOARCH= \
        --volume /tmp/amazon-ecr-credential-helper:/go/src/github.com/awslabs/amazon-ecr-credential-helper \
        sha256:23b97de4f34d4c956e315659157439acfae03f15977d45c57c0e797729064846 \
        make build
git rev-parse --short=7 HEAD > GITCOMMIT_SHA
fatal: detected dubious ownership in repository at '/go/src/github.com/awslabs/amazon-ecr-credential-helper'
To add an exception for this directory, call:

        git config --global --add safe.directory /go/src/github.com/awslabs/amazon-ecr-credential-helper
make: *** [Makefile:95: GITCOMMIT_SHA] Error 128

However running this seems to "fix" this problem.

docker run --rm \
        --user 0:0 \
        --env TARGET_GOOS= \
        --env TARGET_GOARCH= \
        --volume /tmp/amazon-ecr-credential-helper:/go/src/github.com/awslabs/amazon-ecr-credential-helper \
        sha256:23b97de4f34d4c956e315659157439acfae03f15977d45c57c0e797729064846 \
        git config --global --add safe.directory /go/src/github.com/awslabs/amazon-ecr-credential-helper && make build

I have also verified this behaviour on a CICD system.

However I do not see any docs / issues demonstrating this behaviour and it seems incorrect.

@ktasper
Copy link
Contributor Author

ktasper commented May 2, 2024

Fix can be found here: #802

@austinvazquez
Copy link
Contributor

Thanks for opening and looking into this. Closing as resolved.

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

No branches or pull requests

2 participants