{
"name": "My App",
"dockerComposeFile": ["../docker-compose.yml"],
"service": "api",
"workspaceFolder": "/home/my-app",
"extensions": [
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"esbenp.prettier-vscode",
"ashinzekene.nestjs",
"streetsidesoftware.code-spell-checker"
],
"settings": {
"editor.tabSize": 4,
"terminal.integrated.shell.linux": "/bin/bash"
},
"shutdownAction": "stopCompose"
}
Dockerfile used node:lts image.
Steps to Reproduce:
次の場所で Git を検索しています: git
git から Git 2.11.0 を使用しています
> git rev-parse --show-toplevel
> git rev-parse --git-dir
Open repository: /home/my-app
> git fetch
> git status -z -u
> git show :Dockerfile
> git ls-files --stage -- /home/my-app/Dockerfile
> git cat-file -s 7dc09786276bbed090ba950f4fc68a7f42d67fa4
fatal: git cat-file: could not get object info
> git check-ignore -v -z --stdin
> git ls-files --stage -- /home/my-app/Dockerfile
> git cat-file -s 7dc09786276bbed090ba950f4fc68a7f42d67fa4
fatal: git cat-file: could not get object info
> git show :Dockerfile
fatal: failed to read object 2de56757feb7e89df563e796b47310232bc2ffea: Operation not permitted
fatal: the remote end hung up unexpectedly
> git status -z -u
Execute git push in the container terminal and it will complete successfully.
But git fetch fails.
Same problem here on Windows. When I do it on OSX there is no problem.
My container definition contains certain .ssh folder manipulation:
https://github.com/Surveily/Hydra/blob/master/.devcontainer/devcontainer.json
I reckon this is to do with the fact that I first clone the repository on Windows and then open in container that is Linux-based. Perhaps the line endings in .git folder are not correctly understood rendering the repository broken from Linux perspective?
cc @Chuxel @chrmarti
@chrmarti I am able to repro something like this with Docker Desktop 2.2.0.4 on Windows 10 by going to the command line and typing git fetch. Any ideas? Is this a regression on our end or something new with Docker Desktop?
A bit more digging and this might be a Docker bug: https://github.com/docker/for-win/issues/6016
Specifically Cannot open read-only files in bind-mounted volume - and there's a number of linked issues around Git operations in bind mounts which fits.
Okay, I install Docker 2.2.0.4 (43542) linked by https://github.com/docker/for-win/issues/6016#issuecomment-600285551.
after that, Git working correctly!
@kaito3desuyo Awesome! Thanks for the confirmation that the one-off build works! Will mark this as "upstream" for those that encounter it and we can close once the Docker release is out.
Docker Desktop 2.2.0.5 (43884) installed, and git has working correctly.
so this issue closed.
Most helpful comment
Okay, I install Docker 2.2.0.4 (43542) linked by https://github.com/docker/for-win/issues/6016#issuecomment-600285551.
after that, Git working correctly!