1 DL3023
José Lorenzo Rodríguez edited this page 2018-02-04 18:25:10 +01:00

COPY --from cannot reference its own FROM alias

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 ./

Rationale:

Trying to copy from the same image the instruction is running in results in an error.