[Containers] Support using nerdctl to connect to a containerd backend · Issue #6014 · microsoft/vscode-remote-release · GitHub
Skip to content

[Containers] Support using nerdctl to connect to a containerd backend #6014

Open

Description

Kubernetes deprecated Docker as a container runtime after v1.20 at the end of 2020 year with removing in v1.22 in late 2021.

So now there is more and more servers, that uses other container runtimes (containerd, CRI-O) instead of Docker.

But Visual Studio Code Remote - Containers extension doesn't see CRI containers, that using runtime other than Docker, because instead of list of containers I see the placeholder:

Get started with containers by installing Docker or by visiting the help view.

So, is it possible to add support for other container runtimes to VS Code Remote Containers extension?

Activity

  1. MurzNN commented on Dec 8, 2021

    @MurzNN
    Author

    Now we have nerdctl as a Docker-compatible CLI for containerd, maybe we can reuse it instead of docker backend to manage container operations for VS Code Remote Containers extension?

  2. MurzNN commented on Dec 8, 2021

    @MurzNN
    Author

    Removing Dockershim and Docker support from Kubernetes is scheduled for Kubernetes v1.24.

  3. chrmarti commented on Dec 10, 2021

    @chrmarti
    Contributor

    You can use a Docker compatible CLI by changing this setting:
    image

    When I tried nerdctl with lima a while ago, it looked like it was not fully compatible with the Docker CLI yet.

  4. Chuxel commented on Dec 15, 2021

    @Chuxel
    Member

    We should make this more specific about nerdctl. Updating the subject.

    Remote - Containers does not touch container engines or daemons directly but rather interacts with CLIs. It makes no assumptions about how the engine functions. There's no "containerd, CRI-O" CLI per-se. For example, Docker itself uses containerd on Linux, so really it's already supported. Dockershim going away will not have any affect.

    The issue is that each CLI that needs to be supported will require separate work unless it supports everything the docker CLI does with the same arguments. Podman is closest but there are always nuances.

    While the nerdctl CLI is part of the containerd project, it currently has gaps most notably around the missing --mount property that has replaced -v and automatic creation of named volumes in either syntax (nerdctl requires a separate command be called). Would love to see those gaps resolved.

  5. changed the title [-][Containers] Connecting VS Code Remote to container runtimes other than Docker (containerd, CRI-O)[/-] [+][Containers] Support using nerdctl to connect to a container backend[/+] on Dec 15, 2021
  6. MurzNN commented on Dec 16, 2021

    @MurzNN
    Author

    nerdctl is only one option, most easier to integrate (because of Docker compatibility), but we have also crictl that must give compatibility with any CRI-compatible container engine!

    So maybe split the issue to 2 parts - nerdctl and crictl?

  7. changed the title [-][Containers] Support using nerdctl to connect to a container backend[/-] [+][Containers] Support using nerdctl to connect to a containerd backend[/+] on Dec 16, 2021
  8. Chuxel commented on Dec 16, 2021

    @Chuxel
    Member

    We should track crictl as a separate issue. Each CLI will be a separate effort. Raised #6075

  9. Chuxel commented on Oct 12, 2022

    @Chuxel
    Member

    FYI - For those not aware, the dev container CLI is now open source and is what the extension uses to interoperate with container engines if anyone has interest in contributing. https://github.com/devcontainers/cli

  10. Anutrix commented on Mar 28, 2023

    @Anutrix

    Any updates on this?

  11. kidbrax commented on Dec 14, 2023

    @kidbrax

    FYI - For those not aware, the dev container CLI is now open source and is what the extension uses to interoperate with container engines if anyone has interest in contributing. https://github.com/devcontainers/cli

    Chuck Lantz (@Chuxel) I checked the devcontainers/cli repo and searched for APIVersion and got no results. This leads me to believe the change we need is not in that repo, since the command VSCode runs when spinning up a devcontainer (when trying finch) is finch version --format {{.Server.APIVersion}}.

    Is the code for this extension not open? This repo is just for feedback, correct?

  12. Chuxel commented on Dec 14, 2023

    @Chuxel
    Member

    FYI - For those not aware, the dev container CLI is now open source and is what the extension uses to interoperate with container engines if anyone has interest in contributing. https://github.com/devcontainers/cli

    @Chuxel I checked the devcontainers/cli repo and searched for APIVersion and got no results. This leads me to believe the change we need is not in that repo, since the command VSCode runs when spinning up a devcontainer (when trying finch) is finch version --format {{.Server.APIVersion}}.

    Is the code for this extension not open? This repo is just for feedback, correct?

    Yeah, I'd recommend opening an issue in the CLI repository to discuss the specific scenario you are looking into.

    Christof Marti (@chrmarti) is the version check in the CLI or extension? Generally, seems like these kinds of checks should end up in the CLI (if not the broader spec) so they can be contributed, but I'm not sure if this is a proposed feature.

  13. chrmarti commented on Dec 18, 2023

    @chrmarti
    Contributor

    The version check is in the extension. Making that more tolerant now.

  14. jsamuel1 commented on Jan 2, 2024

    @jsamuel1

    nerdctl and finch also don't support --sig-proxy=false
    This appears to be a fixed parameter in devcontainer when using single-container devcontainer configurations.
    https://github.com/containerd/nerdctl/blob/main/docs/command-reference.md#whale-nerdctl-attach

    (Offending Line in devcontainer code: https://github.com/devcontainers/cli/blob/f7d4c853bf8c284d784173f3e915a34d961b0b55/src/spec-node/singleContainer.ts#L396 )

  15. chrmarti commented on Jan 9, 2024

    @chrmarti
    Contributor

    I'm hesitant to make details like --sig-proxy=false conditional on the detected CLI as that might quickly become a long list of cases to distinguish given the growing list of Docker-like CLIs.

    The more tolerant version check is available in Dev Containers extension 0.330.0-pre-release.

  16. Bigous commented on Jan 18, 2024

    @Bigous

    I'm hesitant to make details like --sig-proxy=false conditional on the detected CLI as that might quickly become a long list of cases to distinguish given the growing list of Docker-like CLIs.

    Hi Christof Marti (@chrmarti) ,

    In this case, for docker, you are tuning off the feature... and this feature doesn't even exists in nerdctl... you can safely be "non conditional" just detecting you are using nerdctl (which it already do) and not sending the argument.

    Could that be a solution?

  17. CodeChanning commented on Jun 25, 2024

    @CodeChanning

    A --sig-proxy change was merged to nerdctl yesterday that should supports the flag in run
    containerd/nerdctl#3043

  18. midnight-wonderer commented on Feb 11, 2025

    @midnight-wonderer

    I tried substituting the docker command with nerdctl using the --docker-path option.
    The issue I encountered was with the additional_contexts support detection logic, and possibly also with parseVersion.

    The CLI always determined that nerdctl compose was unsupported, which caused the build to fail.

    ERROR [internal] load metadata for docker.io/library/dev_container_feature_content_temp:latest

    For reference, my nerdctl is integrated with version 0.19:

     buildctl:
      Version:	0.19.0
    

    I wish the docker compose module of the CLI to be refactored into a class, so we can inject the differences as functions into the constructor (or extract the differences to the constructor).

  19. cmullark commented on Apr 18, 2025

    @cmullark

    I tried this today with version 0.409.0 of this extension with finch, which uses nerdctl, instead of docker and I am able to spin up a devcontainer!

    Not sure where the rough edges are yet but this is now possible today.

  20. subesokun commented on Apr 23, 2025

    @subesokun

    Finch's devcontainer Mac integration worked for me: https://runfinch.com/docs/integrations/mac/devcontainers. Consider tweaking the default config (cups, memory, ...): https://runfinch.com/docs/configuration-reference/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

containersIssue in vscode-remote containersfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions