Now all the stages declared in the Dockerfiles are built as images. For example:
# [run] Fedora 28
FROM fedora:28 AS mcode
RUN dnf --nodocs -y install libgnat gcc \
&& dnf clean all --enablerepo=\*
#---
FROM mcode AS llvm
RUN dnf --nodocs -y install zlib-devel \
&& dnf clean all --enablerepo=\*
RUN dnf --nodocs -y install llvm-libs \
&& dnf clean all --enablerepo=\*
#---
FROM mcode AS gcc-8.1.0
RUN dnf --nodocs -y install zlib-devel \
&& dnf clean all --enablerepo=\*
RUN dnf --nodocs -y install libstdc++* libstdc++*.i686 \
&& dnf clean all --enablerepo=\*
This could be cleaner if the installation of zlib-devel was defined in a intermediate 'dummy' stage:
# [run] Fedora 28
FROM fedora:28 AS do-mcode
RUN dnf --nodocs -y install libgnat gcc \
&& dnf clean all --enablerepo=\*
#---
FROM mcode AS zlib
RUN dnf --nodocs -y install zlib-devel \
&& dnf clean all --enablerepo=\*
#---
FROM zlib AS do-llvm
RUN dnf --nodocs -y install llvm-libs \
&& dnf clean all --enablerepo=\*
#---
FROM zlib AS do-gcc-8.1.0
RUN dnf --nodocs -y install libstdc++* libstdc++*.i686 \
&& dnf clean all --enablerepo=\*
Now all the stages declared in the Dockerfiles are built as images. For example:
This could be cleaner if the installation of
zlib-devel
was defined in a intermediate 'dummy' stage: