`MAINTAINER` to `LABEL` conversion does not escape embedded quotes
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
まず、MAINTAINER命令をLABEL値に書き換えるコードを見つけ、値内の引用符をどう処理するか確認します。報告に示されているDockerfileで問題を再現し、該当するformatterのテストを実行します。変換後の値で有効な引用符が保たれ、フォーマット後のDockerfileをビルドできるか、MAINTAINER行が変更されずに残れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Rewriting MAINTAINER into LABEL org.opencontainers.image.authors="..." wraps the value in double quotes without escaping the quotes it already contains.
Reproduce
FROM alpine
MAINTAINER Jane Doe "[email protected]"
dockerfmt Dockerfile
Actual
FROM alpine
LABEL org.opencontainers.image.authors="Jane Doe "[email protected]"
The quotes no longer pair up, and docker build fails on the output:
failed to process "\"Jane Doe \"[email protected]\"": unexpected end of statement while looking for matching double-quote
Expected
Escape embedded quotes:
LABEL org.opencontainers.image.authors="Jane Doe \"[email protected]\""
Leaving MAINTAINER unchanged when the value contains a quote would also work.
Impact
With --write the Dockerfile no longer builds. One of the three MAINTAINER lines in a sample of about 450 real-world Dockerfiles had quotes in its value.
Reproduced with v0.5.4 and with main at a5868c2.
- 主要言語
- Go
- スター
- 626
- フォーク
- 23
- 平均マージ
- 6日 23時間
- マージ済み PR(30日)
- 3
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
reteps/dockerfmt のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Legacy `ENV key value` with a multi-word value becomes an invalid `key=value`対応中かも @RyoKusnadi が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
reteps/dockerfmt の issue をすべて見る
似ている issue
-
Cluster details: the Control Plane version field has a different border color than its icon boxオープンkind/design sig/ui
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
kubermatic/dashboard#8449 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
filecoin-project/curio#1632 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
-
compose: derived node options overwrite each other's targets対応中かも @yangjj-iso が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信