<p>One of the cons of Homebrew for the use of testing your DB stuff is how tightly coupled the DB is to your local environment.</p>

<p>You'll inevitably end up needing to manage the details of what services are running, and possibly needing to manage the versions of multiple installations. This can get complex if you need to install software that needs different versions of dependencies, or if you need to pin a very specific version on your test DB.</p>

<hr>

<p>Docker can probably be a good fit for your usecase.</p>

<p>One of the pros of Docker is the ability to quickly set-up and tear-down. Here's an example:</p>

<p>Because containers have their own filesystem that is isolated from your host, you can start up a mysql:5.6 container, perform whatever operations you need to do for your testing, and stop the container. You can start up another mysql:5.6, (or even a mysql:5.7 container), and it will not matter than you could have destroyed that first container. The instances are independent of each other.</p>

<p>You can even easily stand up several DBs, and do some very complex A-B testing that would take a lot more effort if you were to manage the process with a homebrew installation.</p>

<hr>

<p>It was not mentioned as a need for your usage, but Docker makes it easier to work with developers who use different operating systems, (but can also run docker locally). You can write one set of local development setup/test scripts, and it will generally not require any changes in order to have the same results. </p>

<p>It's a great tool for filtering out "it works on my machine".</p>

CC BY-SA 3.0
2017-07-27T08:30:44.690Z
2017-07-27T08:30:44.690Z
T.J. Telan
<p>One of the advantages of using Docker would be that you can easily run tests with different versions of the (DB) apps, which could be quite difficult with Homebrew (some apps don't easily support multiple versions installed on the same system).</p>

CC BY-SA 3.0
2017-07-19T15:34:46.213Z
2017-07-19T15:34:46.213Z
Dan Cornilescu
<p>Often I test some stuff on my MacBook. Mostly database and data store related stuff (MongoDB, MariaDB, Postgres). I install the software with Homebrew and test.</p>

<p>I wonder if I should switch to docker? What are pros and cons Homebrew vs. Docker for testing things on local Desktop?</p>

<docker><testing><databases><open-source>
macOS testing on Desktop: Docker containers vs. Homebrew installation
Sybil
# macOS testing on Desktop: Docker containers vs. Homebrew installation

(Asked by: username_0 on 2017-07-19)

Often I test some stuff on my MacBook. Mostly database and data store related stuff (MongoDB, MariaDB, Postgres). I install the software with Homebrew and test.

I wonder if I should switch to docker? What are pros and cons Homebrew vs. Docker for testing things on local Desktop?

**Tags:** docker, testing, databases, open-source


---

## 2 answers

### Answer by username_2 on 2017-07-19. Score: 5 | Accepted answer

One of the advantages of using Docker would be that you can easily run tests with different versions of the (DB) apps, which could be quite difficult with Homebrew (some apps don't easily support multiple versions installed on the same system).


---

### Answer by username_1 on 2017-07-27. Score: 4

One of the cons of Homebrew for the use of testing your DB stuff is how tightly coupled the DB is to your local environment.

You'll inevitably end up needing to manage the details of what services are running, and possibly needing to manage the versions of multiple installations. This can get complex if you need to install software that needs different versions of dependencies, or if you need to pin a very specific version on your test DB.

---

Docker can probably be a good fit for your usecase.

One of the pros of Docker is the ability to quickly set-up and tear-down. Here's an example:

Because containers have their own filesystem that is isolated from your host, you can start up a mysql:5.6 container, perform whatever operations you need to do for your testing, and stop the container. You can start up another mysql:5.6, (or even a mysql:5.7 container), and it will not matter than you could have destroyed that first container. The instances are independent of each other.

You can even easily stand up several DBs, and do some very complex A-B testing that would take a lot more effort if you were to manage the process with a homebrew installation.

---

It was not mentioned as a need for your usage, but Docker makes it easier to work with developers who use different operating systems, (but can also run docker locally). You can write one set of local development setup/test scripts, and it will generally not require any changes in order to have the same results.

It's a great tool for filtering out "it works on my machine".


---

