microsoft / AzureTRE

An accelerator to help organizations build Trusted Research Environments on Azure.
https://microsoft.github.io/AzureTRE
MIT License
185 stars 145 forks source link

Git permission issue in Dev Container? #4090

Open jonnyry opened 2 months ago

jonnyry commented 2 months ago

Recently built a fresh Dev Container in VS Code (on Windows) and now seeing the following error when trying to use Git CLI from within the container:

image

I have manually added an exception, but just wanted to raise it as I've not seen it before when building the Azure TRE Dev Container, and wondered whether anyone else had seen it?


This provides a bit of background on Dev Containers & the error in git...

https://www.kenmuse.com/blog/avoiding-dubious-ownership-in-dev-containers/

marrobi commented 2 months ago

@tim-allen-ck hit it last week I think. Didn't consider that it would be a Dev Container issue.

tim-allen-ck commented 2 months ago

me either, I assumed it was me

jonnyry commented 2 months ago

Glad it's not just me :-)

Wonder if its worth sticking the following in devcontainer.json as per that kenmuse.com link above?

"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
a-illarionov commented 2 months ago

a quick workaround is using "sudo -s" running it again and then running the rest in parts...