hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
312 stars 60 forks source link

`FROM`: curly brackets cause syntax error #1794

Closed reidpr closed 10 months ago

reidpr commented 11 months ago

Curly brackets in FROM are a syntax error but should be accepted:

$ printf 'ARG img=alpine\nARG ver=3.17\nFROM ${img}:${ver}\n' | ch-image build -t foo -
error: can’t parse: -/Dockerfile:3,7

FROM ${img}:${ver}
      ^

trace: build.py:211:main, ch-image:323:main

Removing the brackets makes it work (with brackets should be the same):

$ printf 'ARG img=alpine\nARG ver=3.17\nFROM $img:$ver\n' | ch-image build -t foo -
  1  ARG img='alpine'
  2  ARG ver='3.17'
  3* FROM alpine:3.17
updating existing image ...
grown in 3 instructions: foo

Possibly related to #1751.

reidpr commented 10 months ago

Not a duplicate of #1751, as that bug interprets curly braces incorrectly during build rather than throwing a syntax error.