Docker Community Forums

Share and learn in the Docker community.

Ability to create/link docker containers between projects?

I am working on a “base image” for our development team. Part of our setup is to run multiple applications, typically PHP based, on our laptops. Each of these applications has a common requirement, running a database server such as MySQL or Postgres. The idea that we have is to create a container that runs Postgres, and one that runs MySQL that are “always on” and that are shared throughout separate projects but linked.

The structure would look something like this:

  • postgres-server
  • mysql-server
  • project-one : links to postgres-server
  • project-two : links to mysql-server
  • project-three : links to mysql-server

This was the database containers always stay on throughout the workday, and we only need to launch what is necessary for each project (e.g nginx and/or apache).

Any thoughts on how to keep two consistent containers that are separate for our project specific containers yet linked?