Open drsgoodall opened 2 years ago
I've a bit of further testing.
I deleted and re-added "ubuntu-20.04" as my default image. - Can repeatably install the sample. I added the snippet below to setup my ssh-agent - Can repeatably install the sample. I run "wsl" to load up the ssh-agent - Can repeatably install the sample. I run "wsl" and ssh-add in the terminal to load in my ssh key - Sample stops working. I run "wsl" and killall ssh-agent in the terminal, then re-run "wsl" to initialise a new agent - Sample starts working again. I run "wsl" then ssh-keygen to create a new ssh key without a password and add that to my agent - Sample stops working.
SSH Agent snippet added to ~/.profile
SSH_ENV="$HOME/.ssh/agent-environment"
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
}
# Source SSH settings, if applicable
if [ -f "${SSH_ENV}" ]; then
. "${SSH_ENV}" > /dev/null
ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
start_agent;
}
else
start_agent;
fi
By ignoring the ssh instructions in the dev environments instructions and following the instructions for Windows ssh-agent as a service here I was able to clone my own repository into a volume. My wsl no longer has a ssh agent running in it.
By ignoring the ssh instructions in the dev environments instructions and following the instructions for Windows ssh-agent as a service here I was able to clone my own repository into a volume. My wsl no longer has a ssh agent running in it.
I also had the issue that no source code files were present inside the dev environment container. I had the SSH agent running inside WSL too. So I removed the code snippet of the Docker documentation for auto-starting the SSH agent inside WSL and followed the instruction that was linked by @drsgoodall. Afterwards, the source code is available inside the Docker Dev Environment container.
Same issue for me. If I kill ssh-agent in my WSL/Ubuntu session, the sample dev environment configuration completes.
Description
Creating a new dev environment from a git repository fails to populate the volume. The clone appears to work successfully (and if I point to my internal repo it will fail unless I have my ssh key loaded so it is making the connection.) However the language detection fails and it starts up the base dev-environments image rather than a language specific one.
Browsing the the relevant volume in \wsl$\docker-desktop-data\version-pack-data\community\docker\volumes shows an empty _data folder.
This happens with the samples and my own git repos.
Steps to reproduce the issue:
Describe the results you received:
No files in \wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\volume-single-dev-env-_data
Describe the results you expected: Expected the git checkout files to be in \wsl$\docker-desktop-data\version-pack-data\community\docker\volumes\volume-single-dev-env-_data
Version of Docker Desktop:
You can find the version by clicking on the
About Docker Desktop
menuAdditional information you deem important (e.g. issue happens only occasionally): Only the first time I try after rebooting seems to work. Every subsequent attempt fails. Manually copying files into the volume folder "works" Creating a dev environment from a local folder "works"
It seems to me that the volume never
Output of
docker version
:Output of
docker context show
: You can also rundocker context inspect context-name
to give us more details but don't forget to remove sensitive content.Output of
docker info
:Additional environment details (AWS ECS, Azure ACI, local, etc.): Running on up to date Windows 10 with wsl 2 (docker output from Ubuntu 20.04 wsl2 distribution. I have also tried with the "Ubuntu" wsl2 distribution)