Open mjambon opened 5 months ago
ARG CLN_PLUGINS_GIT_HASH \
CLN_PLUGINS_REPO
I think something like this is pretty common we use it extensively to make the dockerfile look neat so maybe its worth supporting. @camdencheek am ready to contribute if can be pointed somewhere and you are willing to accept the change :)
The official documentation makes no mention of supporting multiple variables in a single ARG instruction (https://docs.docker.com/reference/dockerfile/#arg).
However, the
docker
command supports multiple variables. For example, the following does what one would expect:i.e. it prints
a: 1
andb: 2
.ARG can be used to declare variables without a default. Their value can then be set with
--build-arg
. The following declares two variablesa
andb
:Where it gets weird is that it doesn't support comments but it identifies
#
as an ordinary string. The following declares 3 variablesa
,#
, andb
:The following sets
a
to2
even though it seems to be commented out:tree-sitter-dockerfile doesn't currently support this syntax. We might want to support it even though its use should be discouraged.
(In Semgrep, we'd probably add a rule that forbids the use of
#
as a variable name and also maybe forbid multiple variables in a single ARG instruction.)