Skip to content

Files

Latest commit

 

History

History
33 lines (22 loc) · 803 Bytes

DL3000.md

File metadata and controls

33 lines (22 loc) · 803 Bytes

Pattern: Use of relative path for WORKDIR

Issue: -

Description

For clarity and reliability, prefer using absolute paths for your WORKDIR. Also, you should use WORKDIR instead of proliferating instructions like RUN cd … && do-something, which are hard to read, troubleshoot, and maintain.

Example of incorrect code:

WORKDIR usr/src/app

Example of correct code:

WORKDIR /usr/src/app

Exceptions

When using environment replacements.

FROM busybox
ENV foo /bar
WORKDIR ${foo}   # WORKDIR /bar

Further Reading