Skip to content

UndefinedVar build check behaviour for PATH-like variables #2751

Open
@Stikus

Description

According to docs:

Before you reference an environment variable or a build argument in a RUN instruction, you should ensure that the variable is declared in the Dockerfile, using the ARG or ENV instructions.

This is not correct statement - you can append $PATH without any declaration in Dockerfile, as well as some other variables like $LD_LIBRARY_PATH. But not PYTHONPATH:

PYTHONPATH="$SOFT/Stranger-${STRANGER_VERSION}/local/lib/python3.10/dist-packages:$PYTHONPATH"

results warning: UndefinedVar: Usage of undefined variable '$PYTHONPATH' (line 72)

Are there any settings for predefined variables (not in Dockerfile) or how is should be fixed?

Stack Overflow question about this problem.

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions