You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I searched existing issues before opening this one
A feature of Dockerfile syntax (1.6.0) is shell parameter expansion. In Docker Engine, Podman and nerdctl, these can be used to, e.g., fail a build when a build arg is unset ({VAR?} or when empty or unset {VAR:?}). I haven't found documentation for the feature by Docker Inc.
Expected behavior
Shell parameter expansions are parsed. For Hadolint, I presume this requires at minimum expanding the grammar/parser, without doing anything with the semantics.
Actual behavior
Shell parameter expansions not parsed, resulting in fatal failure.
Steps to reproduce the behavior
$ hadolint ContainerfileContainerfile:5:31 unexpected ':' expecting '@', '\', a new line followed by the next instruction, or the image tag
Output of hadolint --version or docker run --rm hadolint/hadolint hadolint --version or docker run --rm ghcr.io/hadolint/hadolint hadolint --version:
Haskell Dockerfile Linter 2.12.0
Dockerfile (if relevant)
# syntax=docker.io/docker/dockerfile:1@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021ARG IMAGE_PREFIX=
ARG DISTRO=alpine
ARG VERSION_DISTRO=3.19
FROM ${IMAGE_PREFIX:?}${DISTRO:?}:${VERSION_DISTRO:?}
The text was updated successfully, but these errors were encountered:
sanmai-NL
changed the title
Dockerfile variable expansion syntax not parsed correctly
Containerfile parameter expansion syntax not parsed correctly
Dec 21, 2023
A feature of Dockerfile syntax (1.6.0) is shell parameter expansion. In Docker Engine, Podman and nerdctl, these can be used to, e.g., fail a build when a build arg is unset (
{VAR?}
or when empty or unset{VAR:?}
). I haven't found documentation for the feature by Docker Inc.Expected behavior
Shell parameter expansions are parsed. For Hadolint, I presume this requires at minimum expanding the grammar/parser, without doing anything with the semantics.
Actual behavior
Shell parameter expansions not parsed, resulting in fatal failure.
Steps to reproduce the behavior
Output of
hadolint --version
ordocker run --rm hadolint/hadolint hadolint --version
ordocker run --rm ghcr.io/hadolint/hadolint hadolint --version
:Dockerfile (if relevant)
Additional environment details (OS, stack version, etc.)
The text was updated successfully, but these errors were encountered: