Although Linux might be the foundation for which most enterprise-level businesses are built, it takes a village of platforms to keep it going. One such platform that is often seen as an ideal developer environment is Apple’s macOS. It’s solid, runs on some of the best hardware on the market, and integrates with peripherals and devices like no other.
But for many macOS users, the idea of installing Docker and Kubernetes, might be a bit daunting. If you’ve ever attempted to install Kubernetes on Linux, you know it’s not a point and click affair. But what about macOS? Does the installation of these two tools require opening a terminal window and working with numerous (and sometimes complicated) commands?
You’re in luck, as there’s a macOS GUI for that very purpose.
Thanks to the developers of Docker Desktop, getting both Docker and Kubernetes up and running on your platform of choice is incredibly simple. Once installed, you’ll have quick access to Docker Hub repositories, the full complement of Docker commands, easy installation of Kitematic (a GUI for container management), and even Kubernetes if you wish to do some testing or just learn how Kubernetes works.
Let’s find out how to install this must-have tool for macOS container developers.
The first thing to do is download the Docker Desktop .dmg file. Once that file is saved on your drive, open Finder and navigate to the folder housing the download. Locate and double-click the Docker.dmg file. When the Docker window opens (Figure A), click and drag the Docker icon to the Applications folder.
Once the installation of Docker Desktop is complete, you’ll find a new icon on your top panel. Click on that icon to reveal the Docker Desktop menu (Figure B).
You’re now ready to install a few more components.
For those who’d prefer not to have to rely solely on the command line, there is the Kitematic GUI. Before you can install Kitematic, you must first install Git. In order to install Git, download the installer. Once downloaded, open Finder, navigate to the folder housing the file, double-click the installer, and walk through the easy-to-follow instructions.
Once Git is installed, you can install Kitematic. Although there is an entry in the Docker Desktop menu for Kitematic installation, don’t use it as it will not result in a successful installation. Instead, download the latest version of Kitematic from GitHub. Once that file is downloaded, open Finder, navigate to the folder housing the file, double-click the installation, and walk through the simple instructions.
At this point, make sure to click the Docker Desktop icon and click the Sign-in entry. Use your Docker Hub account credentials in order to link Docker Desktop to your repositories.
For our next trick, we’ll install Kubernetes support for Docker Desktop. To do this, click the Docker Desktop icon and select Preferences. In the resulting window (Figure C), click on the Kubernetes tab.
Click the checkbox associated with “Enable Kubernetes.” You can also optionally enable Kubernetes to be the default deployer for Docker Stacks and show system containers. Click “Apply” and a popup will appear, informing you the installation requires a network connection and takes some time (Figure D).
Click Install and the installation will start and finish. Once the installation completes, you should see that both the Docker Engine and Kubernetes are running (Figure E).
Before we move on, let’s test to make sure Kubernetes is up and running. Open a terminal window and issue the command:
The command will report that both Kubernetes master and KubeDNS are running (Figure F).
Using Docker Desktop
This is where it gets a bit confusing. You don’t actually use Docker Desktop for working with your containers. Docker Desktop gives you easy access to the tools that allow you to develop and deploy containers. For instance, you can now open a terminal window and start using the docker command as you would from Linux. You could pull down images, modify images, push images, deploy containers and more.
Or, you could opt to work with Kitematic. To open Kitematic click on the Docker Desktop icon and then click Kitematic. When you first run the tool, you’ll be required to give it accessibility privileges. From within the Security & Privacy window (Figure G), make sure to click the checkbox associated with Kitematic.
The GUI will open, requesting your Docker Hub credentials (Figure H).
Once you’ve logged in, you will see a tab with your repositories (Figure I), along with your images, recommended images and more.
You can now start working with images and deploying containers, all from a handy GUI tool. Download an image you want to work with, modify it to suit your needs and deploy.
As for Kubernetes, it is all handled via the command line, unless you install a third-party tool (such as Kubernetic). The good news is, since you have Kubernetes already running on your Mac, the hard part is taken care of. Simply install a third-party GUI tool and you’re ready to start working with your instance of Kubernetes. With the likes of Kubernetic, you can easily create Pods, Services, Ingresses, Deployments and more, all without having to open a terminal window. Of course, if you are serious about learning both Docker and Kubernetes, you should probably make yourself at home with the command line as well.
Easy Docker and Kubernetes
Thanks to Docker Desktop, getting both Docker and Kubernetes up and running on your Mac doesn’t have to be a barrier to entry. With this handy tool, you can be up and running with two of the most important technology building blocks on the market.