Skip to main content
COPY with more than 2 arguments requires the last argument to end with /.
PropertyValue
SeverityError
CategoryCorrectness
DefaultEnabled

Description

If multiple source resources are specified in a COPY instruction, then the destination must be a directory and it must end with a slash /. Omitting the trailing slash causes ambiguity and may lead to build errors or unexpected behavior.

Examples

Problematic code

FROM node:carbon
COPY package.json yarn.lock my_app

Correct code

FROM node:carbon
COPY package.json yarn.lock my_app/

Reference