Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Automated builds for multiple containers

Tags:

github

docker

I have a few containers that are expected to run together. Do I need to create a tiny github repository for each (seems wasteful and inconvenient), or can I use the same github repository as a source for an automated build of multiple containers?

like image 746
Avi Kivity Avatar asked Mar 25 '26 16:03

Avi Kivity


1 Answers

If the containers are expected to be run together then use docker compose to build and run them. The Docker file associated with each container can then be kept in a sub directory.

Example

├── docker-compose.yml
├── one
│   └── Dockerfile
└── two
    └── Dockerfile

docker-compose.yml

web1:
  build: one
  ports:
    - 8080
web2:
  build: two
  ports:
    - 8080
like image 186
Mark O'Connor Avatar answered Mar 27 '26 04:03

Mark O'Connor



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!