Open Stikus opened 1 month ago
you can append
$PATH
without any declaration in Dockerfile, as well as some other variables like$LD_LIBRARY_PATH
It depends if this ENV
has already been declared in the base image.
results warning:
UndefinedVar: Usage of undefined variable '$PYTHONPATH' (line 72)
This means PYTHONPATH
has not been declared in your Dockerfile or the base image you're using.
Does this check actually checks base image? Documentation doesn't have any info about it.
Is there any way to ignore only current case of this check (not all check entirely)? Something like https://github.com/hadolint/hadolint?tab=readme-ov-file#inline-ignores or https://github.com/koalaman/shellcheck/wiki/Ignore#ignoring-one-specific-instance-in-a-file
Does this check actually checks base image?
Yes it does
Documentation doesn't have any info about it.
Indeed we could add a callout about it (cc @dvdksn).
Is there any way to ignore only current case of this check (not all check entirely)? Something like https://github.com/hadolint/hadolint?tab=readme-ov-file#inline-ignores or https://github.com/koalaman/shellcheck/wiki/Ignore#ignoring-one-specific-instance-in-a-file
I recall this has been discussed internally but not sure what is the current state of it. @colinhemmings do we have this scoped to a milestone?
@Stikus, yes, we have something similar to inline ignores on the roadmap, but we don't have a date for it just yet. I will make sure to keep you posted.
Thanks for fast answer, maybe there are any workarounds - like PATH1=${PATH1:-}:/new-path1
or PYTHONPATH="$SOFT/Stranger-${STRANGER_VERSION}/local/lib/python3.10/dist-packages:${PYTHONPATH:-''}"
? To ensure that user is aware about empty variable?
Hello! I am also interested in workarounds... Which one is better?
According to docs:
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: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.