devcontainers / devcontainers/cli

Building a Dockerfile appears to ignore escape directive

Đang mở
#632 1 bình luận 0 reaction 1 người được giao Được @chrmarti nhận Xem trên GitHub
bug
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ả

I'm on Windows and so prefer the escape character in a Dockerfile to be `` ` ``. Using the following Dockerfile errors with `ERROR: failed to solve: dockerfile parse error on line 8: unknown instruction: apt (did you mean add?):
apt (did you mean arg?)`:

```
# escape=`

FROM ubuntu:jammy as build

RUN set -eux; `
apt update;
```

I tried changing the Dockerfile to use LF instead of CRLF for end of lines but that didn't make a difference. Using the following did work, even with CRLF:

```
# escape=\

FROM ubuntu:jammy as build

RUN set -eux; \
apt update;
```
As well as:
```
FROM ubuntu:jammy as build

RUN set -eux; apt update;
```

All of the above Dockerfiles work with Docker CE on Windows. My `.devcontainer/devcontainer.json` is

```
{
"name": "foo",
"build": {
"context": "..",
"dockerfile": "../Dockerfile"
}
}
```
I'm using Dev Containers 0.304.0 in VS Code 1.82.0-insider (f1302be1e67e3af5fbeb8bbb2ea784de7bc96150)

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

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

Đánh giá

Issue này chưa được đánh giá.

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.