Ensure Docker From alias is unique for multistage builds

Error: Docker From alias is not unique for multistage builds

Bridgecrew Policy ID: BC_DOCKER_GENERAL_9
Checkov Check ID: CKV_DOCKER_11
Severity: LOW

Docker From alias is not unique for multistage builds

Description

Using unique FROM aliases in your Docker multistage builds can help improve the security and reliability of your builds. The FROM alias is used to specify the base image for a build stage, and using a unique alias for each stage can help prevent confusion and ensure that the correct image is being used.

Fix - Buildtime

Docker

FROM debian:jesse1 as build
RUN stuff

FROM debian:jesse1 as another-alias
RUN more_stuff