Background:
I am working on a pipeline where i have to build 3 images in parallel step. All of these three image refer to same project. One is main API and two are worker images. I have 3 docker files, one for each. All of these 3 images fetch same PHP version, install same package from ubuntu repo and then install composer dependencies. After that it sets up all 3 images separately. For example API images exposes port 80 endpoint and worker goes with supervisor.
What I am trying to achieve:
My first though was to build an image and upload it to ecr and use that image in each of these image as base. But using this doesn't guarantee that my dependencies will be up to date. I am looking for a way to build one image in same pipeline and use it in next step as base image so i don't have to install dependencies separately for all 3 containers. is it possible or is there a better solution than this that i can try?