Podman 4.0
podman.io
podman.io
- The Docker daemon is actually really useful. It can run containers as other users, perform a bunch of mounting and networking stuff you can't do as rootless (or at least requires some hacky workarounds), and can monitor/maintain your containers. Podman can do lots of this as well, but requires the use of systemd. So in those cases you've just swapped one daemon for another.
- For most of my use cases, I don't really care about rootless. On servers I run all my docker containers as non-root anyway, and if I'm on a workstation I have privileges and don't need rootless.
- Although Podman claims compatibility with Docker, I've always found issues with trying to use it even up to a few months ago, prior to this release. Mostly when trying to use compose, although it does improve every release.
I basically just view the Docker daemon as an init system like systemd. It's a privileged daemon that runs other processes. But for some reason it seems to have been made into a bogeyman.
This avoids having to use kubernetes in production, and something different (like docker-compose) in local.
Being able to search in multiple container registries is very nice, and docker doesn't allow you to do that (to the best of my knowledge). It's very useful if you have a company container registry for example.
Podman comes with the ability to directly run Kubernetes YAML files, so the aforementioned non-standard addon things become unnecessary.
Ever tried getting a team of 100+ engineers to agree between minikube vs docker-compose? It's not fun and produces nothing interesting. Thankfullyy, with Podman such discussions are no longer needed.
Docker should've implemented this about 4-5 years ago, if they wanted to make their product The Best. Instead they became hostile to cool new product ideas, stopped on the ease of use front, and went all-in with Docker Desktop, which is just another non-standard kludge.
I actually wrote more about it on my blog: https://blog.kronis.dev/articles/docker-swarm-over-kubernete...
Though it's essentially inevitable that Swarm will be abandoned some day, so being able to migrate over to either Hashicorp Nomad or some Kubernetes distro is probably paramount, which is when tools like Kompose come in, when that's finally necessary. The problem of what cluster to run on still remains for all of the folks who are stuck with on-prem deployments, since most orgs can't pay for a team to manage a cluster or for bunches of hardware resources to run the full Kubernetes.
In that regard, the best option that i've found so far is either K3s with Portainer, or K3s with Rancher (RKE and probably RKE2 will still be somewhat heavyweight).
If you run `sudo systemctl start podman.socket` on your Podman 3.0+ & systemd system, you get a Docker daemon compatible API listening on your localhost. You can use all your Docker API compatible tools - including vanilla Docker Compose - and it will just use Podman underneath. Compatibility with Docker features may not be 100% yet (I'm not aware of major issues, but I believe they're there), but it's getting to the point that most use cases for Docker's ""legacy architecture"" can be handled by Podman.
And if you don't need an API, it's default off on Linux hosts so you can just use Podman without that additional exposure until you opt in.
On a mac, I do ——restart=unless-stopped and it starts automatically when Docker daemon starts. Does it not work on Linux?
I don't see it as a bad thing, but definitely a weird one. With complex containers you often end up with your init running docker running s6 running the app. All with different configs, with different lifecycle management, different restart behaviour. It's tiring to deal with - I like the idea of moving as much of it to the top level init as possible.
Podman:
- does not mess with your iptables unlike docker. Because of this docker containers can bypass firewall rules set by ufw
- does not creates bridged networks
> One of the guiding factors on networking for containers with Podman is going to be whether or not the container is run by a root user or not. This is because unprivileged users cannot create networking interfaces on the host. Therefore, with rootfull containers, the default networking mode is to use netavark. For rootless, the default network mode is slirp4netns. Because of the limited privileges, slirp4netns lacks some of the features of networking; for example, slirp4netns cannot give containers a routable IP address.
[1]: https://github.com/containers/podman/blob/main/docs/tutorial...
I guess at this point the difference is only the defaults of each system.
See, and in almost all of my use-cases, I really do. I do HPC computing, which is almost always a multi-tenant environment. This makes using Docker really hard to use, security wise. Unfortunately, more and more software/workflows are getting distributed as Docker containers (for very good reasons). This makes my life difficult. So, if I can set it up so that users can more easily work with containers on my HPC compute nodes, I'd be very happy. If the defacto solution ends up as podman (and rootless), then I'm happy.
(Yes, I use Singularity too, but it would be nicer to be able to not have to convert containers).
Now, I do very little with networking and containers, so those types of requirements... I don't care as much about. But I know that is a big feature set for a lot of people here.
Maybe you need firecracker with something along the lines of https://github.com/combust-labs/firebuild?
BTW, are there out there any on premises multi-user HPC clusters with Docker running on the nodes?
The vendor ClusterVision (EMEA, went bankrupt then returned to life) used to offer a cluster deployment option based on OpenStack+Docker; OpenStack for defining the cluster boundary on top of your hardware then Docker serving as the "image" on each compute node layered on top of the regular OS. Not at all a typical use-case for HPC containers, and with hindsight it is fairly obvious how that Byzantine stack resulted in too much complexity for them to support cost-effectively.
I was a sysadmin managing primarily RedHat servers when they yanked Docker away and replaced it with Podman which was capable of handling absolutely zero of our use cases (they all relied on the docker daemon). It couldn't even build our simplest containers from Dockerfiles.
* Systemd integration https://lwn.net/Articles/676938/
* CGroupsv2 - Docker was slow on adopting it, which was dragging down the ecosystem because no distros wanted to unilaterally break Docker by enabling it - so a Docker compatible replacement (ie. Podman) became a blocker for a lot of container functionality in CGroupsv2 that RH wanted to enable for customers.
* Support for rootless / daemon-less containers (enabled by CGroupsv2)
* A lot of enterprise customers wanted support for purely local, private container registries, Docker wanted people to be integrated with DockerHub and were reluctant
(disclaimer: I work for Red Hat, but not on anything container-related, and I was still in college when all that drama was happening, so I don't have much insider perspective here)
The way it was handled pretty much burned what remained of my trust in Redhat to the ground for me. Most of Redhats selling point is that it’s supposed to be stable and as dependable as a bag of hammers, except that’s a lie.
I'm no Redhat fan, but they do have point here. They are not the baddy here.
Interestingly enough, systemd has a feature called nspawn that can be used to run application containers.
Feels unexplained (at least for me), how do I know which to choose when and what are the trade offs?
I recently went deeper on Rancher Desktop and it’s use of containerd vs dockerd backends and it is totally not obvious what you lose if not using dockerd and how you might fill the gaps. Feels like because docker established the space and put a bunch of related components together (cli, image building, image storing and container running) and other projects make difference choices it can be quite confusing to compare them.
i always thought it seemed wrong that it needed either of those to start with.
in most other respects i think it's a drop in replacement.
- does not mess with your iptables unlike docker. Because of this docker can bypass firewall rules set by ufw
- does not creates bridged networks
There are also a bunch of tools that talk directly to the docker socket.
There are a lot of varying use cases here.
Disclaimer, I started Rancher Desktop.
Totally makes sense when you understand more but initial is surprising.
If you are running kubernetes there are k8s daemons already possibly CRI-O containerd Otherwise the pod is started by systemd, which is another daemon
A Started from the command line using podman, is not a production pattern
1. It can form up k8s-style pods for deploying tightly-coupled containers. 2. It can understand k8s YAML for deployment (although obviously it doesn't support everything k8s does), which makes it easier to do deployment config that will work locally with podman and then in a k8s deployment.
Rancher is a Kubernetes implementation that can run containers across multiple hosts. Rancher is more comparable to something like Red Hat OpenShift or Hashicorp Nomad than docker.
I know rancher requires Docker and is not compatible with Podman as of today.
And I believe Red Hat uses Podman in Openshift, their implementation of kubernetes.
For a while Kubernetes has included something called the "dockershim", it's own implementation of a CRI interface that, under the hood, calls Docker or Podman, so Kubernetes "pods" run in Docker/Podman. There's also tools like Kind[3] ("kubernetes in docker") that go further- not just hosting Kubernetes worker containers in Docker, but hosting the main kubernetes daemons also in Docker.
Kubernetes deprecated Dockershim, formally in December 2020, but is just throwing the switch now in the upcoming 1.24, expected mid-April[4]. A company Mirantis has pledged to take over support of Dockershim[5], and is calling the new effort "cri-dockerd"[6]. This should allow Kubernetes workers to continue to run via Docker or Podman.
Kind is unaffected, since it runs the main Kubernetes controllers in Docker, which then launch their own opencontainerd (one off the main CRI implementations) inside that Docker container, nested like, so no dockership/cri-dockerd is needed).
Worth re-noting that Podman includes tools to try to run Kubernetes pods directly, without running the rest of Kubernetes.
[1] https://kubernetes.io/blog/2016/12/container-runtime-interfa...
[2] https://github.com/kubernetes/cri-api
[4] https://kubernetes.io/blog/2022/01/07/kubernetes-is-moving-o...
[5] https://www.mirantis.com/blog/mirantis-to-take-over-support-...
Wow they should advertise that more. I had no idea and I'm pretty deep in the Red Hat ecosystem.
Poke around the different moby components like runc, containerd, buildkit, etc. and you'll start to see how they all form part of docker the CLI tool. For example runc runs a container image, and containerd is a service that can run and manage multiple containers at once (each using runc to run). Buildkit is a tool for building container images. All of these tools assume you're on a linux host, but there are tools like linuxkit, hyperkit to make linux VMs for mac and windows hosts that can then run all the other tools.
Tools like podman, rancher desktop, docker, etc. all more or less use those components and compose them in different ways or with different tweaks to support their view of a container workflow.
> More features, including support for volume mounts from the host, are planned for Podman v4.1, so stay tuned for more updates.
IIUC host volume mounts for podman-machine are the last major missing feature in Podman that would allow something like Podman Desktop Companion [1] to replace Docker Desktop on Windows/Mac for most use cases - if it works well. It'd be great to replace that nagging-for-updates and nagging-for-subscriptions with a completely open source replacement tool. (I'm sympathetic to the Docker team in need of a revenue source, but I'm really happy OCI containers on Mac and Windows can be made accessible without vendor lock-in).
This looks awesome!
And apparently Podman has supported this for years while Docker hasn't :shrugs:.
You can run docker pretty easily on RHEL 8 but you have to downgrade cgroups in order to do so. Plenty of guides out there now.
Buildkit is not exclusive to docker buildx though. You can use this with regular docker build as long as you've set the DOCKER_BUILDKIT environment variable, as noted in the document. You can also forward this to docker-compose, though there's another COMPOSE_DOCKER_CLI_BUILD variable you must set for that.
That said, it looks like this extra frontend syntax is Docker-only, which means you shouldn't use it unless you're committed to the Docker tooling and ecosystem.
At my last job we used Fedora CoreOS with Podman + systemd (I did a talk about it at Fedora Contributor Conference [1]) and I released self hosted installer that ships a Ruby application inside of a Podman pod. You can check out the systemd units here [2]. Using systemd gets you all the dependency management so your App's services start in the right order which is pretty great!
One of the cool things that I love about Podman is running everything inside A Podman pod. You get your own network namespace so you can launch a bunch of services on the same host without cluttering up your host's localhost. Here is a script I use to run Owncast on a Fedora Server [3]. I also have an script I gave my old coworker to launch all of his apps dependencies inside a podman pod [4].
If you are thinking about giving Podman a shot, check out the links and hopefully that can help you get started with or without systemd.
[1]: https://www.youtube.com/watch?v=9qMSHaHGnoY
[2]: https://github.com/forem/selfhost/blob/main/playbooks/templa...
[3]: https://gist.github.com/jdoss/ad87375b776178e9031685b71dbe37...
[4]: https://gist.github.com/jdoss/25f9dac0a616e524f8794a89b7989e...
I have a few apps running on my workstation that I run in Podman pods that have similar service deps (PostgreSQL and MQTT etc). I don't have to worry about making sure my apps are pointed at some random ports for their services and I don't have to deal with changing the ports per service in my application stack. I can just launch them in a pod and get some nice isolation in the pod's network namespace and use the defaults. I think it is a nice pattern to use for local development. I hope that clears things up.
I think this is the same talk: https://www.youtube.com/watch?v=riZ5YPWufsY. Called "replacing docker with podman".
Podman in Linux - https://news.ycombinator.com/item?id=28687229 - Sept 2021 (89 comments)
How to Replace Docker with Podman on a Mac - https://news.ycombinator.com/item?id=28462495 - Sept 2021 (85 comments)
Podman, the open source Docker alternative ported to M1 (Apple Silicon) machines - https://news.ycombinator.com/item?id=28429650 - Sept 2021 (147 comments)
Migrating from Docker to Podman - https://news.ycombinator.com/item?id=28413470 - Sept 2021 (107 comments)
Podman: A tool for managing OCI containers and pods - https://news.ycombinator.com/item?id=28376686 - Sept 2021 (184 comments)
Podman: A Daemonless Container Engine - https://news.ycombinator.com/item?id=26101608 - Feb 2021 (241 comments)
Transitioning from Docker to Podman - https://news.ycombinator.com/item?id=25165195 - Nov 2020 (268 comments)
Podman and Buildah for Docker Users - https://news.ycombinator.com/item?id=21556894 - Nov 2019 (73 comments)
Dockerless, part 3: Moving development environment to containers with Podman - https://news.ycombinator.com/item?id=20503061 - July 2019 (40 comments)
Podman and Buildah available in RHEL 7.6 and RHEL 8 Beta - https://news.ycombinator.com/item?id=19005426 - Jan 2019 (50 comments)
Podman will pass on the socket-activated socket to the container.
I wrote a small example demo for setting up socket activation with systemd, Podman, and a MariaDB container:
https://github.com/eriksjolund/mariadb-podman-socket-activat...
*There's still some bad blood out there about it, so I just wanted to make explicit that I'm not making a value judgment on docker's refusal. I'm not educated enough on the details to make a fair judgment. Sometimes you have to say "no" to features to protect your product.
1) Podman has two documentation entry points (https://docs.podman.io and https://podman.io/getting-started/) because... ? It is confusing to the user at first. It makes more sense to have everything in one place.
2) Podman does not _actually_ offer binary releases (but claims to do so here: https://podman.io/getting-started/installation#windows and https://github.com/containers/podman/blob/main/docs/tutorial...) because... ? They want me to compile it myself?
3) The Windows installation tutorial links to another article (https://www.redhat.com/sysadmin/podman-windows-wsl2) that is, by today's measurements, _very_ old, because... ? I cannot imagine that things have not changed since then, I refuse to believe it :D
From what I understand, Podman will become an _actually_ easy to use and viable solution to Docker for Desktop once Podman 4.1 has been released, and we have host volume mount support, which is a must-have feature for development.
What if I wanted to: keep using Cilium with Pod in the future, or having a chains of multiple CNIs ?.
EDIT: the second "virtual networks" meant to say "virtual interfaces"
[1]: https://www.cni.dev/
The former will be replaced by the latter in the long run.
https://github.com/docker/compose-cli/issues/901#issuecommen...
Hopefully it will, since the docker-compose spec is being formalized: https://github.com/compose-spec/compose-spec
Any reason for why you want to change?
For Podman vs Rancher, what are pros and cons? If you only use Docker from the command line is there any reason to use Rancher?
Seemd version 4.0 is a nice release.
1. nerdctl did not support registry mirrors for image pulls. This is an obvious blocker for some uses cases.
2. with Docker Desktop you can bind container ports to any interface on the host system, including e.g. ip aliases on localhost. It didn't seem to be possible with nerdctl using whatever VM backend Rancher is using.
2a. I'm not sure how this works today, but with Docker Desktop a `docker pull` can interact with a registry available on the host's localhost address (i.e. through an SSH tunnel established on the host). This worked with Rancher, but I believe I had to edit /etc/hosts inside the Rancher-controlled VM to point at a different IP address, whereas with Docker Desktop it just worked.
I also seemed to recall needing to manually start things with Rancher, i.e. just having the app open was not enough for docker/kubectl/nerdctl to be ready to go. But I don't remember at this point.
These are all (I hope) uncommon and weird use cases, but they are the sort of thing that will keep some people using Docker Desktop instead of an alternative. They are, for better or worse, the value add of Docker Desktop.
For me, this is still the roadblock:
> More features, including support for volume mounts from the host, are planned for Podman v4.1, so stay tuned for more updates.
I do not run many self-contained containers and I usually end up mounting a local folder in the container, so I'll have to wait a little bit longer to fully transition to Podman.
Also, it doesn't have a native interface like docker desktop and it works mostly through the terminal. Last time I checked, there are some external tools that add a Docker Desktop app like on top of podman.
You can look up what a podman volume is to see the difference.
nerdctl is a client app which speaks to containerd, which is a long running daemon.
podman uses a different architecture (no long running daemon)
Both projects use runc to actually launch the containers.
Containerd has been around a long time, it was originally part of Docker itself, but was separated out and is now a standalone project.
Docker uses containerd as part of it's standard deployment.
Containerd is a long running daemon (similar to dockerd), so that's where the difference lies in that podman (in it's default setup) doesn't have a long running daemon.
The closest analogy to containerd in RH land is CRI-O.
So not yet, but planned.
Disclaimer, I started Rancher Desktop
I have Podman on my radar, will give it a shot next year, so far it still feels still quite bleeding edge. But kudos to red hatters for another major release!
[1] Fully knowing there is v3.0.0 in repos for Stable, but switching to Testing just because podman?
There is multipass which can be installed on my M1 Mac with:
> brew install multipass
I can create a minikube container, or I can create an Ubuntu container and install microk8s.