Property
Languageterraform
Severityhigh
Vulnerability Typeomission

Description#

The Dockerfile uses a relative path for the WORKDIR instruction instead of an absolute path. This can lead to unpredictable working directory locations depending on the build context or previously set WORKDIRs, reducing clarity and reliability.

Impact#

Using a non-absolute WORKDIR may cause applications or scripts within the container to run in unintended directories, increasing the risk of file access errors, misconfigurations, or accidental overwriting of files. This can lead to unstable builds, potential data loss, or security missteps within containerized environments.

Resolution#

Use absolute paths for your WORKDIR