I have a docker, DockerB, which is based on DockerA. I want to make sure that whenever DockerB is built (e.g. using docker build ... DockerB
), it first builds DockerA and then builds DockerB. What is the best way to achieve that?
Currently I am using shell scripts to achieve that but that doesn't sound like a good solution since other developers can still directly run docker build
and accidently use an old version of DockerA.
Please note that I don't want to merge content of both Dockerfiles because there are other dockers which depend on DockerA. So it has to be a separate docker.