Devcontainer not working anymore

I cannot start the existing devcontainer anymore after upgrade to Docker 4.7.1

I then started to create a new environment following the process described in the documentation, but that fails with the same problem:

[82 ms] Remote-Containers 0.231.6 in VS Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977).
[81 ms] Start: Resolving Remote
[107 ms] Start: Check Docker is running
[108 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[993 ms] Server API version: 1.41
[996 ms] Start: Run: docker volume ls -q
[2019 ms] Start: Run: docker build -f C:\Users\kongo09\AppData\Local\Temp\vsch\bootstrap-image\0.231.6\bootstrap.Dockerfile -t vsc-volume-bootstrap C:\Users\kongo09\AppData\Local\Temp\vsch\bootstrap-image\0.231.6

[+] Building 0.1s (1/2)
 => [internal] load build definition from bootstrap.Dockerfile             0.0s
 => => transferring dockerfile: 2B                                         0.0s
failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount737255136/bootstrap.Dockerfile: no such file or directory
[3593 ms] Command failed: docker build -f C:\Users\kongo09\AppData\Local\Temp\vsch\bootstrap-image\0.231.6\bootstrap.Dockerfile -t vsc-volume-bootstrap C:\Users\kongo09\AppData\Local\Temp\vsch\bootstrap-image\0.231.6
[3594 ms] Exit code 1

By now I have found a solution which might or might not apply to others:

Method 1

  • fork the core repository as described in the official documentation
  • clone your fork to your local machine
  • open the corresponding folder in Visual Studio Code
  • at least for me, VSC recognized a Docker file and asked all sorts of questions which I confirmed. At the end it started a lengthy build process to create the container.
  • I’m not sure if that works generally as I might have installed stuff in my VSC that is a pre-requisite

Method 2

  • someone on Discord suggested to delete /var/lib/docker/tmp or wherever the docker temp directory is on your machine
  • then rebuild the container
  • I haven’t tried that myself

I had the same problem when opening my first devcontainer. Solved byt changing docker version. I removed the snap installation and used apt docker.io. I now have docker 24.0.5.