Skip to content

Files

Latest commit

 

History

History
26 lines (16 loc) · 496 Bytes

DL3044.md

File metadata and controls

26 lines (16 loc) · 496 Bytes

Pattern: Use of self-referencing ENV variable

Issue: -

Description

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.

Example of incorrect code:

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

Example of correct code:

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

Further Reading