UndefinedVar build check behaviour for PATH-like variables #2751
Open
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 theARG
orENV
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.