devcontainers / devcontainers/cli

Building a Dockerfile appears to ignore escape directive

オープン
#632 コメント 1 件 リアクション 0 件 担当者 1 名 @chrmarti が担当を希望しています GitHub で見る
bug
主要言語
TypeScript
スター
3k
フォーク
457
平均マージ
13時間 17分
マージ済み PR(30日)
6

説明

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)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。