Merge pull request #7 from returntocorp/mj-from-param
Prevent '--platform=xxx' after 'FROM' from being mistaken for the image name
This commit is contained in:
commit
dd2673d44c
|
@ -71,3 +71,18 @@ FROM sourcegraph/alpine:3.12@sha256:ce099fbcd3cf70b338fc4cb2a4e1fa9ae847de21afdb
|
|||
digest: (image_digest))
|
||||
as: (image_alias)))
|
||||
|
||||
==================
|
||||
From with param
|
||||
==================
|
||||
|
||||
FROM --platform=linux/arm64 alpine-${VERSION}-z
|
||||
|
||||
---
|
||||
|
||||
(source_file
|
||||
(from_instruction
|
||||
(param)
|
||||
(image_spec
|
||||
(image_name
|
||||
(expansion
|
||||
(variable))))))
|
||||
|
|
|
@ -211,7 +211,10 @@ module.exports = grammar({
|
|||
)
|
||||
),
|
||||
|
||||
image_name: ($) => repeat1(choice(/[^@:\s\$]+/, $.expansion)),
|
||||
image_name: ($) => seq(
|
||||
choice(/[^@:\s\$-]/, $.expansion),
|
||||
repeat(choice(/[^@:\s\$]+/, $.expansion))
|
||||
),
|
||||
|
||||
image_tag: ($) =>
|
||||
seq(
|
||||
|
|
Loading…
Reference in a new issue