microsoft / microsoft/vscode-remote-release

Fallback to previous container if failing to build

Open
#10,837 2 comments 1 reaction 1 assignee View on GitHub

@chrmarti is already working on this.

Since Apr 1, 2025.

containers feature-request
Dominant language
Dockerfile
Stars
4.2k
Forks
469
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Hi,

I am using the devcontainers in VSCode. I am using the Dev Containers extension and running the Dev Containers: Rebuild Container command.

The problem is what happens when the build fails. Then you really don't have a dev environment anymore - you have to fix this problem, now, to be able to do your normal job - you can't decide to fix it later on in the day, everything is blocked until the issue is fixed. And if the fix is something outside of your control (e.g. a devcontainer feature fails to install, e.g. here), then you're in trouble - suddenly you have no dev environment anymore and you cannot write any code.

This is not a great position to be in. This issue can be partly addressed with devcontainers prebuilds (e.g. here), but only partly - there is still some code which runs on your machine which might cause the build to fail. Prebuilds are meant to speed up creation of devcontainers, but they're not there to ensure availability.

All this to say: I would like to be able to fallback to the latest container I was using if the latest rebuild fails. So that I can still do everything I need, I can still program and make progress, and at my leisure I can go and fix the devcontainer image.

Right now rebuilding the devcontainer is a leap of faith - if it does not work, you're stuck with no alternative. Would be nice if we could fallback to the latest image if the building fails (something like Dev Containers: Reuse latest available image or something like that).

Let me know what you think!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.