Hi
With a multistage build how to achieve a reusable logic approach as follows
Extract shared logic into a base image
FROM ubuntu
ONBUILD ARG LOGIC_PARAM
ONBUILD RUN # some action related to $LOGIC_PARAM
Prebuild this as local/some-reusable-logic
And then how to provide individual build args controlled from the image it self down to each stage separately as
FROM local/some-reusable-logic AS pipeA # parameterize with LOGIC_PARAM=A
FROM local/some-reusable-logic AS pipeB # parameterize with LOGIC_PARAM=B
FROM ubuntu
COPY --from= pipeA /target targetA
COPY --from= pipeB /target targetB
Thanks