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

fix(docker): add git safe dir to data dir #720

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

janderssonse
Copy link
Contributor

Fixes the requirement that: Newer versions of git needs the 'git config --global --add safe.directory /data' setting to work in a container.

Here is an example to verify both the problem and the fix:

Problem:

  1. .Build an reuse image from latest main code, official branch:

docker build -f docker/Dockerfile-debian -t reusetest_default .

2). Run the code in reuse compliant project, I used my script project (https://github.com/janderssonse/janderscripts)

docker run --rm --volume $(pwd):/data reusetest_default lint

Result: Fails respecting .gitignore etc as the git config will fail and show warning '---no VCS'' etc.

Fix:
3). Now try the same dockerfile but with the added fix in this pr:

docker build -f docker/Dockerfile-debian -t reusetest_with_git_add_data_safe .

4). Run on same example repo as before (https://github.com/janderssonse/janderscripts)

docker run --rm --volume $(pwd):/data reusetest_with_git_add_data_safe lint

Result: success - git (vcs) accepted, .gitignore respected etc.

Signed-off-by: Josef Andersson <josef.andersson@gmail.com>
@linozen
Copy link
Member

linozen commented Apr 7, 2023

Many thanks @janderssonse for bringing this issue up and providing a fix right away. I tested this locally and all seems to work as expected again using your fix.

@linozen linozen merged commit 7d46fd1 into fsfe:main Apr 7, 2023
carmenbianca added a commit to carmenbianca/reuse-tool that referenced this pull request Apr 7, 2023
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
carmenbianca added a commit to carmenbianca/reuse-tool that referenced this pull request Apr 7, 2023
Signed-off-by: Carmen Bianca BAKKER <carmenbianca@fsfe.org>
@janderssonse janderssonse deleted the feature/add-git-safe-data-dir branch April 16, 2023 18:37
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