devcontainers / devcontainers/cli

Fails with `# syntax=devthefuture-org/dockerfile-x`

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

描述

Hi there,

In my case, I fork an open source project which defines its own devcontainer Dockerfile.

However, I need to make changes to it. If I make my changes directly in the Dockerfile, every time I pull from this upstream repository I will have merge conflicts to resolve.

I wanted to use https://github.com/devthefuture-org/dockerfile-x#from to avoid this.

Here's how it works:

- `.devcontainer/Dockerfile`

```dockerfile
FROM ubuntu
```

- `.devcontainer/fork.Dockerfile`

```dockerfile
# syntax = devthefuture/dockerfile-x

FROM ./Dockerfile

RUN echo add my customizations
```

And it works great when using Docker CLI with `docker build .devcontainer -f .devcontainer/fork.Dockerfile`.

But `devcontainer build` fails with:

```console
❯ devcontainer build --workspace-folder .
[14 ms] @devcontainers/cli 0.75.0. Node.js v22.14.0. linux 6.8.0-52-generic x64.
[351 ms] Path './dockerfile' for input 'docker.io/./dockerfile' failed validation. Expected path to match regex '/^[a-z0-9]+([._-][a-z0-9]+)*(\/[a-z0-9]+([._-][a-z0-9]+)*)*$/'.
invalid reference format: repository name (Dockerfile) must be lowercase
{"outcome":"error","message":"Command failed: docker inspect --type image ./Dockerfile","description":"An error occurred building the container."}
```

Can you please alleviate this check to support this use case? I would be very grateful.

贡献指南

打开贡献指南

调研方向

首先使用 `.devcontainer/Dockerfile` 和 `.devcontainer/fork.Dockerfile` 通过 `devcontainer build --workspace-folder .` 重现故障,然后跟踪 CLI 如何处理本地输入 `FROM ./Dockerfile`。完成标准是接受此 Dockerfile 语法,而不将其验证为镜像引用,同时现有的 Docker 构建仍能继续工作。

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

评估

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

把新 issue 发到你的邮箱

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