devcontainers / devcontainers/cli

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

Đang mở
#991 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
3k
Fork
457
Merge trung bình
13 giờ 17 phút
Pull request đã merge (30 ngày)
6

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Trước tiên, hãy tái hiện lỗi bằng `devcontainer build --workspace-folder .` sử dụng `.devcontainer/Dockerfile` và `.devcontainer/fork.Dockerfile`, sau đó theo dõi cách CLI xử lý đầu vào cục bộ `FROM ./Dockerfile`. Công việc được xem là hoàn tất khi cú pháp Dockerfile này được chấp nhận mà không bị xác thực như một tham chiếu image, trong khi các bản build Docker hiện có vẫn tiếp tục hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, typescript
Lĩnh vực
build-system, devops
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
48/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.