Ensure not to use the same alias in multiple 'FROM'

Using the same FROM alias in multi-stage build can ocurred by mistyping or confusing and could create a wrong behavior.

Risk Level: high
Platform: Docker
Spectral Rule ID: DOCKR049

REMEDIATION

Make sure each FROM stage has unique alias name by as.

FROM ubuntu:22.10
RUN ...

FROM ubuntu:foo as foo
RUN ...

- FROM ubuntu:foo as foo
+ FROM ubuntu:foo as bar
...

Read more: