I have a problem. My daily laptop is a MacBook Pro, which is great unless you want to dual boot into Linux and develop on containers. While it is simple enough to install Red Hat CodeReady Containers, what I really needed was a way to run Buildah, Podman, and skopeo on macOS without having to water and feed a Linux VM.
Apple’s Mac OS X is preinstalled on Macs, but Macs are now just another type of PC with the same standard hardware inside. The only thing stopping you from installing Mac OS X on a typical PC is Apple’s license agreement and the way they limit their software.Mac OS X can run just fine on typical PCs if you can get around these restrictions. As with every upgrade since the original release of Mac OS X, we have to make changes to CCC to accommodate the changes in this new OS. As the numeric change would suggest, though, this is the biggest change to macOS since Apple introduced Mac OS X roughly 20 years ago. The system now resides on a 'Signed System Volume'.
Look no further: Podman-machine has somewhat solved this problem.
Podman-machine starts a virtual machine that already streamlines the Podman, Buildah, and skopeo packages. The developers released two VM flavors: an in-memory Tiny Core and a Fedora version.
You have the option of compiling additional driver support for hypervisors like xhyve, but I would recommend VirtualBox as it seems to work more smoothly.
My instructions are based on the official ones here. The guide also assumes you have VirtualBox already installed.
Start by downloading the latest podman-machine
binary. At the time of this writing, the latest release was v0.16:
Then, create a boot2podman
VM. I am using a Fedora 31 virtual machine with 4GB of RAM, and I attached my local ~/Code
directory to this VM.
I updated the image to Fedora 31 and allowed rootless image building. The image should make it to the official repo. In the meantime, I referenced the development release below:
You now have a VM with a persistent disk for container images, but it runs the OS in memory. You can log into the VM and view your shared directory at /sf_code
:
Now, let’s run a container and communicate with it:
In another terminal, run:
Finally, you can create containers on your Mac and communicate with them.
To stop and clean up your workspace, run:
Now you can easily build, run, and push containers from your Mac.