From 103379c3a7ae2ba299240a54c26a497115dfd332 Mon Sep 17 00:00:00 2001 From: davegallant Date: Sun, 17 Oct 2021 13:41:09 +0000 Subject: [PATCH] deploy: ec1312280a0cbb05a08c4dbff5d46b74a3e4ba29 --- .../index.html | 18 +++++++++--------- page/search/index.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html b/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html index 3d926e4b..79f48b95 100644 --- a/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html +++ b/blog/2021/10/11/replacing-docker-with-podman-on-macos-and-linux/index.html @@ -155,16 +155,16 @@ personal blog

...ignoring Docker updates is a paid feature now?? pic.twitter.com/ZxKW3b9LQM

— Brendan Dolan-Gavitt (@moyix) May 1, 2021

Docker has been one of the larger influencers in the container world, helping to standardize the OCI Image Format Specification. For many developers, containers have become synonymous with terms like docker and Dockerfile (a file containing build instructions for a container image). Docker has certainly made it very convenient to build and run containers, but it is not the only solution for doing so.

-

This post briefly describes my experience swapping out docker for podman on macOS.

+

This post briefly describes my experience swapping out docker for Podman on macOS.

What is a container?

A container is a standard unit of software that packages up all application dependencies within it. Multiple containers can be run on a host machine all sharing the same kernel as the host. In Linux, namespaces help provide an isolated view of the system, including mnt, pid, net, ipc, uid, cgroup, and time. There is an in-depth video that discusses what containers are made from, and near the end there is a demonstration on how to build your own containers from the command line.

By easily allowing the necessary dependencies to live alongside the application code, containers make the “works on my machine” problem less of a problem.

-

Benefits of podman

-

One of the most interesting features of podman is that it is daemonless. There isn’t a process running on your system managing your containers. In contrast, the docker client is reliant upon the docker daemon (often running as root) to be able to build and run containers.

+

Benefits of Podman

+

One of the most interesting features of Podman is that it is daemonless. There isn’t a process running on your system managing your containers. In contrast, the docker client is reliant upon the docker daemon (often running as root) to be able to build and run containers.

Podman is rootless by default. It is now possible to run the docker daemon rootless as well, but it’s still not the default behaviour.

I’ve also observed that so far my 2019 16" Macbook Pro hasn’t sounded like a jet engine, although I haven’t performed any disk-intensive operations yet.

-

Installing podman

-

Running podman on macOS is more involved than on Linux, because the podman-machine must run Linux inside of a virtual machine. Fortunately, the installation is made simple with brew (read this if you’re installing podman on Linux):

+

Installing Podman

+

Running Podman on macOS is more involved than on Linux, because the podman-machine must run Linux inside of a virtual machine. Fortunately, the installation is made simple with brew (read this if you’re installing Podman on Linux):

brew install podman
 

The podman-machine must be started:

# This is not necessary on Linux
@@ -191,7 +191,7 @@ Error: error preparing container 99ace1ef8a78118e178372d91fd182e8166c399fbebe0f6
 
podman run -p 4242 --rm -ti alpine
 

If you’re reading this from the future, there is a good chance specifying a port won’t be needed.

Another example of running a container with Podman can be found in the Jellyfin Documentation.

-

Aliasing docker with podman

+

Aliasing docker with Podman

Force of habit (or other scripts) may have you calling docker. To work around this:

alias docker=podman
 

podman-compose

@@ -225,12 +225,12 @@ podman start -a davegallant.github.io_hello_world_1 Hello world

This should more or less provide the same results you would come to expect with docker. The README does clearly state that podman-compose is under development.

Summary

-

Installing podman on macOS was not seamless, but it was manageable well within 30 minutes. I would recommend giving podman a try to anyone who is unhappy with experiencing forced docker updates, or who is interested in using a more modern technology for running containers.

-

One caveat to mention is that there isn’t an official graphical user interface for podman, but there is an open issue considering one. If you rely heavily on Docker Desktop’s UI, you may not be as interested in using podman yet.

+

Installing Podman on macOS was not seamless, but it was manageable well within 30 minutes. I would recommend giving Podman a try to anyone who is unhappy with experiencing forced docker updates, or who is interested in using a more modern technology for running containers.

+

One caveat to mention is that there isn’t an official graphical user interface for Podman, but there is an open issue considering one. If you rely heavily on Docker Desktop’s UI, you may not be as interested in using podman yet.

Update: After further usage, bind mounts do not seem to work out of the box when the client and host are on different machines. A rather involved solution using sshfs was shared here.

-

I had been experimenting with podman on Linux before writing this, but after listening to this podcast episode, I was inspired to give podman a try on macOS.

+

I had been experimenting with Podman on Linux before writing this, but after listening to this podcast episode, I was inspired to give Podman a try on macOS.