Skip to main content

Documentation Index

Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt

Use this file to discover all available pages before exploring further.

COPY --from cannot reference its own FROM alias.
PropertyValue
SeverityError
CategoryCorrectness
DefaultEnabled

Description

A COPY --from instruction must not reference the same stage it is running in. Trying to copy from the current stage results in an error because the stage has not yet been finalized.

Examples

Problematic code

FROM debian:jesse as build
COPY --from=build some stuff ./

Correct code

FROM debian:jesse as build
RUN stuff

FROM debian:jesse
COPY --from=build some stuff ./

Reference