Hacker News new | ask | show | jobs
by jbnorth 1578 days ago
Just because I happened to be dealing with this today (on Windows with WSL2 but same rules apply) I'll make a comment.

The issue I ran into was due to Docker for Desktop binding the local filesystem into the devcontainer running in a WSL2 VM.

The solution to this is to instead use a named volume in your docker-compose.yml and in your Dockerfile copy the files from your working directory into your devcontainer.

This provided an incredible improvement in the performance of using devcontainers in vscode. The one big drawback to this approach that I've run into is needing to make sure I commit and push my code to a git repo when I'm done working as there's not a copy stored on my local machine.