COPY with more than two arguments not ending with slash
| Property | |
|---|---|
| Language | |
| Severity | |
| Vulnerability Type | omission |
Description#
A Dockerfile COPY command with more than two arguments requires the destination path (last argument) to end with a slash. Omitting the trailing slash can cause files to be copied incorrectly, resulting in an unintended directory structure within the image.
Impact#
Incorrectly structured images may lead to application failures, missing dependencies, or misconfigurations. This can introduce unpredictable behavior, break deployments, or expose sensitive data if files are placed in unintended locations.
Resolution#
Add slash to last COPY argument