This is a feature suggestion, which I believe would be much useful.
Consider scenario as there is a util (e.g brew) which can install multiple packages
FROM alpine:3.7 as build
ONBUILD ARG CLOUD
ONBUILD RUN if [ "${CLOUD}" = "aws" ]; then echo 'installing aws'; fi
ONBUILD RUN if [ "${CLOUD}" = "gce" ]; then echo 'installing gce'; fi
As a consumer of this utility, I can install the utilities from the base image, while adding multiple utilities of mine also;
FROM my-onbuild
RUN echo 'installing my-super-cool-aws-util'
But at final step I would need to build my image as
docker build --build-arg CLOUD=aws -t cool .
It would be nice to have if from final Image (cool here) I define those args within docker file,
and they are automatically added to build context's args even for builder image
FROM my-onbuild
ARG CLOUD=aws
RUN echo 'installing my-super-cool-aws-util'
Raising it in cli repo as 1 quick way to handle this is, scan the current docker file add all non-null args as build-args (if not already added).
Thanks
This is a feature suggestion, which I believe would be much useful.
Consider scenario as there is a util (e.g brew) which can install multiple packages
As a consumer of this utility, I can install the utilities from the base image, while adding multiple utilities of mine also;
But at final step I would need to build my image as
docker build --build-arg CLOUD=aws -t cool .It would be nice to have if from final Image (cool here) I define those args within docker file,
and they are automatically added to build context's args even for builder image
Raising it in cli repo as 1 quick way to handle this is, scan the current docker file add all non-null args as build-args (if not already added).
Thanks