8000 DL3044 · hadolint/hadolint Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Petter Friberg edited this page Apr 3, 2024 · 2 revisions

Do not refer to an environment variable within the same ENV statement where it is defined.

Problematic code:

ENV FOO=bar \
    BAZ=${FOO}/bla

Correct code:

ENV FOO=bar
ENV BAZ=${FOO}/bla

Rationale:

Docker will not expand a variable within the same ENV statement where it is defined. While it will not crash Docker, it carries a high likelihood of errors.

Clone this wiki locally
0