devcontainers / templates

Repository for Dev Container Templates that are managed by Dev Container spec maintainers. See https://github.com/devcontainers/template-starter to create your own!
https://containers.dev/templates
MIT License
990 stars 254 forks source link

dotnet:0-:imageVariant}: invalid reference format #113

Closed Andomeda83 closed 1 year ago

Andomeda83 commented 1 year ago

Forgive me, I'm new to containers so I'm presuming I'm missing a key piece.

I've cloned this repo, and when I run devcontainer build --workspace-folder src/dotnet-mssql/ I get the following error:

[2208 ms] Start: Run: docker inspect --type image mcr.microsoft.com/devcontainers/dotnet:0-:imageVariant}
[2492 ms] Parsed path 'devcontainers/dotnet:0-' for input 'mcr.microsoft.com/devcontainers/dotnet:0-:imagevariant}' failed validation.
[2492 ms] Error fetching image details: Could not parse image name 'mcr.microsoft.com/devcontainers/dotnet:0-:imageVariant}'
[2492 ms] Start: Run: docker pull mcr.microsoft.com/devcontainers/dotnet:0-:imageVariant}
invalid reference format
[2752 ms] []
[2752 ms] Error response from daemon: no such image: mcr.microsoft.com/devcontainers/dotnet:0-:imageVariant}: invalid reference format

{"outcome":"error","message":"Command failed: docker inspect --type image mcr.microsoft.com/devcontainers/dotnet:0-:imageVariant}","description":"An error occurred building the container."}

I can see imageVariant is an option in devcontainer-template.json, but it seems the default value isn't being picked up. I also don't see a way of setting the option.

Am I doing something wrong?

samruddhikhandale commented 1 year ago

Hi 👋

These Templates are expected to work unmodified with the Dev Container Extension.

Can you install the extension? Then, follow the instructions mentioned in https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container

Lastly, this is the Template you will search for with the Dev Containers: Add Dev Container Configuration Files... command.

image

Andomeda83 commented 1 year ago

Thank you for getting back to me.

I can confirm that works, thank you. I perhaps misread https://containers.dev/supporting. I thought each one was a working tool, sorry.

samruddhikhandale commented 1 year ago

@Andomeda83 This document refers another way which uses devcontainers CLI to add the Template --> https://github.com/devcontainers/cli/pull/388/files