Podman and Buildah for Docker users

https://gitlab.com/gitlab-org/gitlab-runner/issues/4185

https://github.com/containers/libpod

https://podman.readthedocs.io/en/latest/Introduction.html

 

I was asked recently on Twitter to better explain Podman and Buildah for someone familiar with Docker.  Though there are many blogs and tutorials out there, which I will list later, we in the community have not centralized an explanation of how Docker users move from Docker to Podman and Buildah.  Also what role does Buildah play? Is Podman deficient不足的 in some way that we need both Podman and Buildah to replace Docker?

This article answers those questions and shows how to migrate to Podman.

 

How does Docker work?

First, let’s be clear about how Docker works; that will help us to understand the motivation for Podman and also for Buildah. If you are a Docker user, you understand that there is a daemon process that must be run to service all of your Docker commands. I can’t claim to understand the motivation behind this but I imagine it seemed like a great idea, at the time, to do all the cool things that Docker does in one place and also provide a useful API to that process for future evolution. In the diagram below, we can see that the Docker daemon provides all the functionality needed to:

  • Pull and push images from an image registry
  • Make copies of images in a local container storage and to add layers to those containers
  • Commit containers and remove local container images from the host repository
  • Ask the kernel to run a container with the right namespace and cgroup, etc.

Essentially the Docker daemon does all the work with registries, images, containers, and the kernel.  The Docker command-line interface (CLI) asks the daemon to do this on your behalf.

 

 

This article does not get into the detailed pros and cons of the Docker daemon process.  There is much to be said in favor of this approach and I can see why, in the early days of Docker, it made a lot of sense.  Suffice it to say that there were several reasons why Docker users were concerned about this approach as usage went up. To list a few:

  • A single process could be a single point of failure.
  • This process owned all the child processes (the running containers).
  • If a failure occurred, then there were orphaned processes.
  • Building containers led to security vulnerabilities.
  • All Docker operations had to be conducted by a user (or users) with the same full root authority.

There are probably more. Whether these issues have been fixed or you disagree with this characterization is not something this article is going to debate. We in the community believe that Podman has addressed many of these problems. If you want to take advantage of Podman’s improvements, then this article is for you.

The Podman approach is simply to directly interact with the image registry, with the container and image storage, and with the Linux kernel through the runC container runtime process (not a daemon).

Now that we’ve discussed some of the motivation it’s time to discuss what that means for the user migrating to Podman.  There are a few things to unpack here and we’ll get into each one separately:

  • You install Podman instead of Docker. You do not need to start or manage a daemon process like the Docker daemon.
  • The commands you are familiar with in Docker work the same for Podman.
  • Podman stores its containers and images in a different place than Docker.
  • Podman and Docker images are compatible.
  • Podman does more than Docker for Kubernetes environments.
  • What is Buildah and why might I need it?

 

 

Related Articles

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2019-05-16 18:20  ChuckLu  阅读(383)  评论(0编辑  收藏  举报