I'm in the situation where I have a bunch of images which come from different sources, but I need to apply the same steps to them. Basically it looks like this:
# dockerfile 1
FROM source1
RUN foo
# dockerfile 2
FROM source2
RUN bar
# dockerfile 3
FROM source3
RUN baz
Given these images, I need to apply some common steps, eg copy certificates, install commonly-used packages, set environment variables, etc.
ENV http_proxy http://proxy-server-address
ENV https_proxy http://proxy-server-address
ADD certs/* /usr/local/share/ca-certificates/
RUN apt install something -y
RUN pip install something-else
# etc
Is there a good way to do this for all the images, without duplicating all the steps into each dockerfile? That would be a maintenance headache, since every time I change a step, I have to make sure I do it for all the files.