devcontainers / devcontainers/cli

Add support for Dockerfile using a variable within their FROM line, today it fails due to usage of docker inspect not handling the ARG

未关闭
#673 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug info-needed
主要语言
TypeScript
星标
3k
派生
457
平均合并
13 小时 17 分钟
30 天内合并 PR
6

描述

I have a Dockerfile that needs to use an ARG in the FROM line:

https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact

```
ARG VERSION=latest
FROM busybox:$VERSION
ARG VERSION
```

This works with docker build but fails with devcontainer because devcontainers try to build the FROM image name without honoring the ARG and call docker inspect which then return a failure.

```
[126 ms] @devcontainers/cli 0.52.1. Node.js v18.18.2. linux 5.15.0-86-generic x64.
{"outcome":"error","message":"Command failed: docker inspect --type image busybox:VERSION","description":"An error occurred building the container."}
```

贡献指南

打开贡献指南

调研方向

首先,使用 devcontainers CLI 复现提供的 Dockerfile,并检查调用 `docker inspect --type image` 的路径。将 Dockerfile 示例和 Docker 的 ARG/FROM 行为作为验收用例:必须能够解析镜像引用而不出现 `busybox:VERSION` 错误,同时普通的 FROM 行仍应能够成功构建。

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

评估

技术栈
docker, typescript
领域
build-system, cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

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