12/28/2021

Macos Docker

34
  1. Macos Docker Alternative
  2. Macos Docker
  3. Macos Docker Engine
  4. Macos Docker Daemon
  5. Macos Docker Vm
  6. Macos Docker Log

If you are trying to run Mac OS as the base system in a Docker container, unfortunately there is no way to do it. Docker container need to use the host machine's Linux Kernel, since Mac OS family is Unix-based operating system, currently Docker cannot simulate a Mac OS in Docker container. Here is a link to explain how container works. MacOS and Windows have traditionally not supported the Linux-based container technology that powers Docker, but the latest release of Docker for Mac and Windows now makes it easier to get started creating and running containers in those environments with less overhead. Let’s put a simple Node.js application in a Docker container as an example.

Want to use Podman to work with containers? Here's what you need to know about Podman on a Mac.

Macos Docker Alternative

Several months ago, I came back to my desk after lunch and to my chagrin, my macOS was making a long constant blowing sound—the fan was on high speed. Now, mind you, I have a fairly new and beefy Mac. 2.4 GHz, 8-core, 64GB running Big Sur, 11.2.1. So what in the world could be triggering my fan to such a high level? I discovered that the culprit was Docker. And the only way to rid myself of the noise was a Docker restart.

At that moment, I added a task to my To-Do list: Replace Docker with Podman. However, early attempts and initial research proved difficult simply because I wanted it to be just as easy to start Podman on my Mac as is the Docker client. I use Alfred (Spotlight replacement) and launch most things with a quick cmd+space. So, if I couldn’t do the same with Podman, I was going to have to take a hard pass on the replacement. And, unfortunately, there isn’t a one-click, easy Podman macOS install, so I had to stitch a couple of few items together to get that quick launch. To help you have a better experience, I've documented the process here.

[ Readers also liked: From Docker Compose to Kubernetes with Podman ]

Resources

More about automation

A couple of months ago, I was able to get Podman running on my Mac via podman-machine, but I ran out of time and motivation to convert it into something easy to launch. Fast forward a couple of months, podman-machine is now deprecated in lieu of Vagrant. I found a couple of good articles, like Brent and Ashley’s post on podman remote, which provided most of my answer and helped me figure out how to deal with some fun podman.sock errors. However, I couldn’t find my holy grail. I mean, I’m a lazy dude. My frustration level is measured by the amount of typing or clicks it takes me to do something. And if it’s more than a couple of clicks, I’ll need to go eat more pizza to calm me down. So, here it is in three main parts: The pre-requisites, creating a script, and then creating the macOS app.

Prerequisites

1. You’ll need the latest version of VirtualBox

2. Install Vagrant

3. Run $ brew install podman

Create the script

4. Create a directory to store the Vagrantfile, such as /Users/[username]/tools/podman (you’ll need to modify scripts below to use this directory)

5. Create the following Vagrantfile in your new directory. I’m using Andres’ Vagrant file, but I found others as well.

6. Add the following lines to your ~/.zshrc file to create global environment variables for the Podman host and SSH key. This step allows you to make a successful connection in any terminal window. Note the second variable contains a directory that needs to be changed to reflect your setup.

7. Create the following bash shell script. Note the change required to reflect your setup. I called my script pman.

Macos docker

At this point, you can open a terminal and type $ pman up to start Podman. But, I told you I was lazy, right? That’s way too many clicks and keypresses for my taste, so I made this a macOS app.

Make it a macOS app

1. Open up Automator on your Mac, and choose Application as your document.

2. Drag and drop the Run Shell Script item into the workflow, and type the following script:

Macos Docker

Note: The example path ~/Dev/bin/pman will need to be updated to where you saved and named the bash script above.

Macos Docker

3. Save the Application. It should save directly into the Mac Applications folder. I called my Podman application Seals because of the Podman logo.

4. As an added bonus, I found the Podman logo and created a 128x128 PNG image with GIMP to use as the application icon:

  1. Open the 128x128 png in preview and click Edit > Copy
  2. Right-click the new Application, and click Get Info.
  3. Select the icon on the top left, and paste the contents of the clipboard.

[ Get this free ebook: Managing your Kubernetes clusters for dummies. ]

Macos Docker Engine

Wrap up

Macos Docker Daemon

There you have it. Now you can use Spotlight or Alfred to run Podman. It’s just a cmd+space and a couple of letters away.

Macos Docker Vm

Check out these related articles on Enable Sysadmin

Macos Docker Log

Use the additionalimagestores field to set up read-only shared image storage for multiple Podman containers.
  • Most Viewed News

    • Windows 7 Iso Download
    • Office 365 Mac Offline Installer
    • Mac Os X Lion Google Drive
    • Install Conda In Docker