Below is the dockerfile that creates an image:
FROM diamol/base AS build-stage
RUN echo 'Building...' > /build.txt
FROM diamol/base AS test-stage
COPY --from=build-stage /build.txt /build.txt
RUN echo 'Testing...' >> /build.txt
FROM diamol/base
COPY --from=test-stage /build.txt /build.txt
RUN echo 'Done...' >> /build.txt
and my understanding is, the final image consists layers of diamol/base and the layer created after the last RUN command as picture below shows:
Is my understanding correct?