Skip to content

Devcontainer create with private feature fails in VS Code but works in CLI. #7987

Closed
@jglogan

Description

@jglogan

Hi, I'm trying to extract devcontainer setup code into features and am unable to open in VS Code any devcontainer that references a feature that I've published to our Artifactory repo. The same devcontainer.json works, however, if I bring it up using the devcontainer CLI.

All I can see in the VS Code log are messages that say:

[2023-02-06T20:39:21.692Z] Failed to parse manifest: 
[2023-02-06T20:39:21.692Z] (!) WARNING: Falling back to deprecated GitHub Release syntax. See https://github.com/devcontainers/spec/blob/main/proposals/devcontainer-features.md#referencing-a-feature for updated specification.
[2023-02-06T20:39:21.692Z] Github feature.
[2023-02-06T20:39:21.692Z] Could not resolve Feature 'docker.xyz.com/john/devcontainer-features/test-feature-alpine:0'.  Ensure the Feature is published and accessible from your current environment.
[2023-02-06T20:39:21.692Z] Error: Failed to process feature docker.xyz.com/john/devcontainer-features/test-feature-alpine:0

It looks like when I invoke the CLI with the same read-configuration subcommand that appears to fail in VS Code, the feature manifest is retrieved successfully using bearer authentication.

One item of note is that when I publish the features, I do have to manually specify DEVCONTAINERS_OCI_AUTH to avoid authorization errors.

Is there something additional I need to do so that VS Code can successfully retrieve the feature manifest and create the devcontainer? Thank you for any help you can provide!

.devcontainer.json:

{
    "workspaceMount": "source=dev-in-container-data,target=/workspace,type=volume",
    "workspaceFolder": "/workspace",
    "image": "alpine:latest",
    "features": {
        "docker.xyz.com/john/devcontainer-features/test-feature-alpine:0": {}
    },
    "customizations": {
        "vscode": {
            "extensions": [
                "vscjava.vscode-java-pack",
                "vscjava.vscode-gradle",
                "ms-azuretools.vscode-docker",
                "redhat.vscode-yaml"
            ]
        }
    },
    "mounts": [
        "source=/var/run/docker.sock,target=/var/run/docker-host.sock,type=bind"
    ]
}
  • VSCode Version: 1.75.0
  • Local OS Version: MacOS 13.1
  • Remote OS Version: Alpine Linux v3.17.1
  • Remote Extension/Connection Type: Containers

Steps to Reproduce:

  1. Reopen a project in a devcontainer that includes a feature published to a private repository (see attached devcontainer.json for a redacted example).
  2. Open in container fails immediately with "An error occurred setting up the container." alert. Run Dev Containers Developer: Show All Logs... and open the latest log.
  3. Copy the arguments for the failing devContainersSpecCLI.js script command and invoke the devcontainer CLI with the same arguments. Command is successful.

Does this issue occur when you try this locally?: N/A
Does this issue occur when you try this locally and all extensions are disabled?: N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    containersIssue in vscode-remote containers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions