I have a web application image (
web) and a database image (
db) that needs to be run using
Since my web app needs a content management system to be installed as well, I would like to make an image out of that (
web-cms-db) and use that instead.
However, the problem is that how do build an image which has a container (i.e it should be running) as a dependency? I need to be able to reach the service.
docker-compose seems to have a
build option so I tried using that, but the only problem is that the
database container won't be running during the build phase!
I think I can do something using the networking layer, but I was wondering if I could use
docker-compose for this as the only additional requirement is to have the container running.
version: "3.1" services: database: image: database web: build: context: ../web dockerfile: Dockerfile image: web-cms-local-db-image
Maybe I could create a dummy
docker-compose up that leverages the networking?