Skip to content

Erroneous "failed to process string" error and syntax highlighting for Dockerfile parameter substitution modifier - #184

Description

I'm getting an erroneous error message for the following string:

"failed to process "${HTTP_PROXY-http://corporate-proxy.com:8080}": unsupported modifier (/) in substitution dockerfile-utils(44)

This string replacement is in fact not an error, - is recognized as a valid environment replacement modifier and / is interpreted as the literal character, not a substitution modifier, when performing the substitution (see: docker/docs#23165).

It appears that this is also breaking syntax highlighting.

Image

Tested and confirmed locally:

# Dockerfile
ARG HTTP_PROXY
ENV http_proxy=${HTTP_PROXY-http://corporate-proxy.com:8080}
RUN echo $http_proxy

# No build arg
$ docker build -f Dockerfile .
> http://corporate-proxy.com:8080

# Build arg null
$ docker build --build-arg HTTP_PROXY="" -f Dockerfile .
> 

# Build arg value
$ docker build --build-arg HTTP_PROXY="override" -f Dockerfile .
> override

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions