<p>I can confirm that running Docker on Mac works just fine, but according to <a href="https://serverfault.com/q/607443/556723">this ServerFault question</a>, it's not possible to just run MacOS in Docker. </p>

<p>(You might be able to run MacOS in a VM in a Docker container, but that's probably not what you want.)</p>

<p>You could purchase a MacMini, use it as a Jenkins slave and run automated tests on it as part of your build pipeline or something like that?</p>

CC BY-SA 4.0
2020-01-29T16:44:18.707Z
2020-01-29T16:44:18.707Z
Lykanion
<p>Back in the day I attended a meetup and they had a Mac Mini for testing Apple related stuff.</p>

<p>At my previous job we had docker images and these were run on Linux, Mac and Windows. The Windows docker environments were less stable, but it worked well on Linux and Mac. All developers were using a Mac and they used docker on a daily basis.</p>

<p>In conclusion, from a cost and DevOps perspective I would prefer using docker over using a Mac Mini as the mac mini will not be used in production will the same docker image should be used in dev, test, acc and prod (DTAP). </p>

CC BY-SA 4.0
2019-12-24T20:15:20.103Z
2019-12-24T20:15:20.103Z
030
<p>As part of the CI setup, I'd like to run (automated) tests on native macOS GUI software in a 'safe environment' (i.e. without messing with the host software installation too much). Virtual machines (using VirtualBox) work in principle, but they are fairly slow to start/stop and VirtualBox on macOS hosts doesn't seem to be very stable (it works great on Linux hosts though).</p>

<p>After reading <a href="https://devops.stackexchange.com/q/1562/12754">macOS testing on Desktop: Docker containers vs. Homebrew installation</a> I learned that using Docker works great for testing software on macOS. However, my understanding is that even with <a href="https://docs.docker.com/docker-for-mac/" rel="nofollow noreferrer">Docker Desktop for Mac</a> (which uses Hyperkit to virtualize the OS as opposed to running VMs using VirtualBox), the software running in the container sees a Linux installation.</p>

<p>Would it be plausible to use Docker anyway (maybe I misunderstood it?) such that the containerized program sees a macOS installation or would some other solution (A plain <code>chroot</code>?) work better here?</p>

<continuous-integration><containers><testing><virtualization><dtap>
How can I test native macOS UI software in a container before deployment?
Frerich Raabe
# How can I test native macOS UI software in a container before deployment?

(Asked by: username_0 on 2019-03-06)

As part of the CI setup, I'd like to run (automated) tests on native macOS GUI software in a 'safe environment' (i.e. without messing with the host software installation too much). Virtual machines (using VirtualBox) work in principle, but they are fairly slow to start/stop and VirtualBox on macOS hosts doesn't seem to be very stable (it works great on Linux hosts though).

After reading [macOS testing on Desktop: Docker containers vs. Homebrew installation](https://devops.stackexchange.com/q/1562/12754) I learned that using Docker works great for testing software on macOS. However, my understanding is that even with [Docker Desktop for Mac](https://docs.docker.com/docker-for-mac/) (which uses Hyperkit to virtualize the OS as opposed to running VMs using VirtualBox), the software running in the container sees a Linux installation.

Would it be plausible to use Docker anyway (maybe I misunderstood it?) such that the containerized program sees a macOS installation or would some other solution (A plain `chroot`?) work better here?

**Tags:** continuous-integration, containers, testing, virtualization, dtap


---

## 2 answers

### Answer by username_1 on 2020-01-29. Score: 1 | Accepted answer

I can confirm that running Docker on Mac works just fine, but according to [this ServerFault question](https://serverfault.com/q/607443/556723), it's not possible to just run MacOS in Docker.

(You might be able to run MacOS in a VM in a Docker container, but that's probably not what you want.)

You could purchase a MacMini, use it as a Jenkins slave and run automated tests on it as part of your build pipeline or something like that?


---

### Answer by username_2 on 2019-12-24. Score: 0

Back in the day I attended a meetup and they had a Mac Mini for testing Apple related stuff.

At my previous job we had docker images and these were run on Linux, Mac and Windows. The Windows docker environments were less stable, but it worked well on Linux and Mac. All developers were using a Mac and they used docker on a daily basis.

In conclusion, from a cost and DevOps perspective I would prefer using docker over using a Mac Mini as the mac mini will not be used in production will the same docker image should be used in dev, test, acc and prod (DTAP).


---

