Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Feature request: `@devcontainers/cli` as a docker CLI plugin

未关闭
#827 0 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
docker, shell, typescript
领域
cli, devops

调研方向

首先检查现有的 @devcontainers/cli 命令入口点,以及 issue 中引用的 Docker CLI 插件约定。将所请求的 docker devcontainer build 和 run 形式与当前的 devcontainer up 和 exec 命令进行比较,然后阅读链接的 pull requests 和 issue。完成的要求是确定一致认可的插件设计、命令映射和 shell 补全范围。

由索引模型根据 Issue 内容生成。

描述

feature-request

We've found it difficult to on-board users accustomed to the docker CLI to @devcontainers/cli.

It would be awesome if @devcontainers/cli were a docker CLI front-end plugin, similar to docker compose, docker buildx, etc.

Partially the motivation is similar to existing issues/PRs -- having a way to use the CLI without node would be great:

This would also hopefully provide incentive to better align with docker CLI idioms. For example:

  • The docker CLI has docker build, and Buildx/compose have docker buildx build and docker compose build.
  • The docker CLI has docker run, and compose has docker compose run.
  • etc.

For example, in the absence of devcontainer run <args>, we find ourselves writing scripts to wrap @devcontainers/cli and mimic the behavior:

local container_id rm up_args exec_args;

_parse_args_somehow rm up_args exec_args;

on_exit() {
    local code=$?;
    if test -n "${rm-}" && test -n "${container_id-}"; then
        docker rm -f "${container_id}" >/dev/null 2>&1 || true;
        container_id="";
    fi
    exit "${code}";
}

trap on_exit EXIT;

container_id="$(devcontainer up ${rm:+--remove-existing-container} "${up_args[@]}" | jq -r '.containerId')";

devcontainer exec --workspace-folder . --config <path> "${exec_args[@]}";

It would be really neat to type docker devcontainer build . or docker devcontainer run --rm -it ..., especially if the @devcontainers/cli plugin also shipped shell completions!

主要语言
TypeScript
星标
3k
派生
461
平均合并
18 分钟
30 天内合并 PR
5

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

devcontainers/cli 的其他 Issue

查看 devcontainers/cli 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。