Closed casparjespersen closed 4 years ago
O.K. the base image can be stable. But the user uses it's own, "tagged variant" image which should be instantly available.
Docker images have no versions, only tags.
To tag the image registry must be available because of local image can't be tagged.
Docker build can be broken easily by Docker upgrade, switch between docker end-points, Network configuration, used custom tools versions, etc. This is not a 100% reproducible process. But the user doesn't always need the last development environment version to correct a bug in the project. The user needs a development environment that is usable to correct a bug. Also, new project features don't always require a new development environment upgrade. A user who deploys his project to separate "testing" landscape positively doesn't want to deal with development environment rebuild in the testing landscape. Runtime dependencies vs. Development dependencies. The test result depends on dev tools in rare cases because dev dependencies issues appear during the build.
Docker exec git fetch & build
@PavelSosin-320 Did you intend to post your reply in this thread?
@casparjespersen To be sure: You expect the container to get the SSH keys from the SSH agent on Windows, correct?
Does ssh-add -l
work on Windows? Maybe your SSH agent service on Windows is not running?
@chrmarti Correct. This was also the behaviour before I upgraded to Win10 2004 and enabled WSL2.
Observation: Disabling WSL2 engine in Docker did not have any effect, hence I suppose it must be related to the Windows upgrade.
ssh-add -l
on my Windows actually provides a different error message:
Error connecting to agent: No such file or directory
This is different than what I receive when doing it inside the container ("communication with agent failed"). I am not an expert in how SSH works, so I'm not 100% on what to derive from this difference. However, what I can say:
Before upgrading Windows 10 to version 2004 (version 1909):
After upgrading Windows 10 to version 2004:
After writing the previous reply and digging a bit further, I figured out that the Windows upgrade had for some reason disabled the ssh-agent
service.
Following the guidelines on this StackOverflow post fixed the issue.
PS C:\Developer> ssh-agent
unable to start ssh-agent service, error :1058
PS C:\Developer> Get-Service ssh-agent
Status Name DisplayName
------ ---- -----------
Stopped ssh-agent OpenSSH Authentication Agent
PS C:\Developer> Get-Service ssh-agent | Select StartType
StartType
---------
Disabled
PS C:\Developer> Get-Service -Name ssh-agent | Set-Service -StartupType Manual
PS C:\Developer> ssh-agent
PS C:\Developer> Get-Service ssh-agent
Status Name DisplayName
------ ---- -----------
Running ssh-agent OpenSSH Authentication Agent
So in the end, this had nothing to do with devcontainers/vscode remote. Closing the issue.
1.48.2
2.3.0.4
Windows 10 Version 2004
mcr.microsoft.com/vscode/devcontainers/python:3.7
Steps to Reproduce:
I am unable to use Git/SSH inside by devcontainer. This worked perfectly before upgrading to Version 2004 of Windows and running Docker with WSL2. Now I am receiving the following error when the container opens:
However, the container can start. This error prompts periodically while container is running. When I open up a bash shell inside the container and execute
ssh-add-l
, I receive the following:The result of this is that I am not able to use Git inside the devcontainer environment.