microsoft / vscode-dev-containers

NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!
https://aka.ms/vscode-remote
MIT License
4.7k stars 1.41k forks source link

Need option to opt-out dev container features #1671

Closed developStorm closed 1 year ago

developStorm commented 1 year ago

Right now the extension always builds vsc-workspace-id-features image on top of the images specified in devcontainer.json, even when no dev container feature is used.

If user specifies --pull always in runArgs, this behavior causes problems: Docker will try to pull the image from docker hub (and would't find it), despite it was just built locally by the extension, causing the workspace to not load. It also breaks pulling policy specified by user as now the local image is used so there's nothing to pull unless a rebuild is manually triggered on updated image.

I can think of two fixes of this for now: disable this local feature image creation if there's no dev container feature in used, or add an option to allow users explicitly opt-out from this local image creation.

Thanks for helping out!

Steps to Reproduce:

  1. create an devcontainer.json with "image": and runArgs: ["--pull", "always"]
  2. open the workspace with Remote - Containers.
  3. the workspace failed to load with docker error "...requested access to the resource is denied...", as it tries to pull a non-exists image from hub.
developStorm commented 1 year ago

Sorry posted this in the wrong repo. Moved to https://github.com/microsoft/vscode-remote-release/issues/7378