15 ms·
Fly To Podman: a script that will help you to migrate from Docker
- gdevenyi 2y agoI can't use podman until they start releasing up to date packages for all systems I use. Have they started releasing packages yet?
- worthless-trash 2y agoNot enough data provided. Packages exist for systems.
- DistractionRect 2y agoThey offer packages but if you're on a point release distro you'll want to build it from source. On my Debian box, I build the podman release target in a chroot, extract the archive in /opt/, and use stow to install/uninstall the package. You'll also want the latest crun, but which I also place in stow and install with stow.
- DrBenCarson 2y agoThis is fine for Linux users and the actual servers, but for local development on a Mac, you cannot beat Orbstack (imo)
- mdaniel 2y agoOn the off chance it matters to anyone, brew whines that podman requires macOS 13.x due to https://github.com/containers/podman/issues/22121 https://github.com/containers/podman/issues/22121 but that's only for $(podman machine start) support, which relies on https://github.com/crc-org/vfkit/issues/37 https://github.com/crc-org/vfkit/issues/37 If you already have colima lying around, that means you have lima and lima ships with both podman and podman-rootful templates: limactl create --name=proot template://podman-rootful --vm-type=qemu --cpus=4 --memory 4 --disk 20 # it will emit the instructions at the end, but for context podman system connection add lima-proot "unix:///$HOME/.lima/proot/sock/podman.sock" podman system connection default lima-proot podman version # <-- off to the races
- deleted 2y ago[deleted]
- MrThoughtful 2y agoI never tried Podman. I guess the benefit is that it runs on demand and not as a always on demon? How does one install podman on Debian and how does one get a Debian image to run inside podman?
- natebc 2y ago1) Podman is available in default debian repos. https://packages.debian.org/bookworm/podman https://packages.debian.org/bookworm/podman 2) `podman run --entrypoint="" --rm -it debian:stable /bin/bash` in most instances you can just alias docker to podman and carry on. It uses OCI formatted images just like docker and uses the same registry infrastructure that docker uses.
- aragilar 2y agoInstalling `podman-docker` will do the aliasing for you.
- MrThoughtful 2y agoWhere does it pull the Debian image from? I would think the Docker infrastructure is financed by Docker Inc as a marketing tool for their paid services? Are they ok when other software utilizes it?
- natebc 2y agoBy default it uses whatever is in registries.conf for unqualified-search-registries. You can specify in the fully qualified image name if you'd like. I can't speak to what Docker Inc. is okay with or not.
- FireInsight 2y agoOn my system it asks between a few different public registries, and dockerhub/docker.io is one of the choices. t's all public infrastructure for hosting container images, I don't think Docker-the-company minds other software interfacing with it. After all, they get to call them 'Docker images', 'Dockerfiles', and put their branding everywhere. At this point
- vednig 2y agoJust read the source code. Script does almost all of the things required for the "existing docker containers", migrating networks, blocks, restart mech,etc, that leaves out just one thing migrating any other third party script utilizing docker to podman based instructions. This would highly improve the experience. Goodluck
- kalaksi 2y agoWhat if I'm using docker-compose?
- darrenf 2y agoUse podman-compose? https://docs.podman.io/en/latest/markdown/podman-compose.1.html https://docs.podman.io/en/latest/markdown/podman-compose.1.h... https://github.com/containers/podman-compose https://github.com/containers/podman-compose
- boudin 2y agoOr just use docker compose with podman. There's a section in arch's doc about that https://wiki.archlinux.org/title/Podman https://wiki.archlinux.org/title/Podman
- tengbretson 2y agoThere are options, but my experience has not exactly been positive.
- Cyph0n 2y agoEnable the Podman socket and have it alias the Docker socket. Shameless plug: Alternatively, if you are on NixOS, you can just use compose2nix. https://github.com/aksiksi/compose2nix https://github.com/aksiksi/compose2nix
- jjice 2y agoHas Podman become more user friendly in recent years? I gave it a go about three or four years ago now when Docker began their commercial push (which I don't have an issue with). This was for some hobby project, so I didn't spend a ton of time, but it definitely wasn't as set-and-forget as Docker was. I believe I had to set up a separate VM or something? This was on Linux as the host OS too. It's been a while, so apologies for the hazy memory. Or it's very possible that I botched the entire setup. In my perfect world, it's a quick install and then `podman run`. Maybe it's time to give it another go.
- evilduck 2y agoThis is mostly solved I think. I run Podman Desktop on macOS and just aliased Docker to Podman in zshrc and it just works for me. I don’t do any local k8s or anything crazy, but it works with my compose files. I’m going to guess there’s still rough edges if you want GPU passthrough or something with complex networking, but for a server and a database running together it matches Docker itself.
- mixedCase 2y agoOn NixOS it was as trivial as `podman.enable = true;`. IIRC on Arch it was just a matter of installing the package. It's all daemonless, rootless and runs directly with your host kernel so it should be as simple as it an application of this kind gets. Probably you followed some instructions somewhere that involved whatever the podman equivalent for docker-machine is?
- sieve 2y agoIt is not user-friendly, but it works flawlessly once you get used to it. I stayed away from docker all these years and tried podman from scratch last year after docker failed to work for a project I was experimenting with. Took an hour to read various articles and get things working. One thing I liked was it does not need sudo privileges or screw with the networking.
- butshouldyou 2y agoMay I ask what issue you ran into with Docker? I'm interested in Podman simply because I'm curious, but I can't think of any reason to move away from Docker besides that.
- lbhdc 2y agoLast year I transitioned all of my personal projects to use podman. The biggest surface area was converting CI to use podman to build my docker files, but also changed out tooling to use it (like having kind use it instead of docker). For the most part this worked without issue. The only snag I ran into was my CI provider can't use oci formatted images. Podman lets you select the format of image to build, so I was able to work around this using the `--format=docker` flag.
- mikedelfino 2y agoAre you pulling base images from Docker Hub, or do you build all images from source from scratch?
- lbhdc 2y agoI am pulling from a few registries, but trying to move everything to a private registry. In podman, you have to use the "full path" to work with docker hub. Eg `docker.io/library/nginx`.
- codelion 2y agoThat's a pretty cool migration story! I've been meaning to give podman a more serious look. The OCI image format issue is good to know about – hadn't considered that compatibility angle. I'm curious, did you notice any performance differences in your CI builds after switching?
- lbhdc 2y agoIts been a while, so all my telemetry has since expired, but there was no meaningful difference in time. I was prepared to roll it all back, but I never ended up running into problems with it. It's just something that happens in the background that I don't have to think about.
- jmholla 2y agoYea, I was under the impression docker uses OCI containers these days and not their own custom definition. But I may be ill-informed.
- whalesalad 2y agoIf you are using docker in this carefully assembled stateful way - you are doing it wrong. You should be using docker via scripts and IaaS tooling that will assert your desired setup from some kind of configuration. Meaning, you should be able to easily blow all of that away and recreate it with a single script. Likewise, a transition to podman should involve adjusting your scripts to re-assert that plan against podman instead of docker. This is a cool tool for the decrepit hand-configured server with no documentation that has been running since 2017 untouched and needs an update... but I would encourage you to not fall into this trap to begin with.
- pinoy420 2y agoYeah in theory. In practice that never happens for anything other than a vercel app.
- osigurdson 2y agoPodman is interesting as well because it can run Kubernetes yamls (to a small extent) which can be handy.
- evantbyrne 2y agoDoes Podman have a swarm counterpart, or does running services still effectively require configuring systemd and then switching to kubernetes for multi-machine?
- KronisLV 2y agoIt doesn't, which to me seems like a bummer. Docker Compose is really great for multi-container deployments on a single machine. And Docker Swarm takes that same Compose specification (although there were historical differences) and brings it over to clusters, all while remaining similarly simple. I'm surprised that ourside of Docker Swarm, Nomad or lightweight Kubernetes distros like K3s there haven't been that many attempts at simple clustering solutions. Even then, Kubernetes (which Podman supports) ends up being more complex.
- Spivak 2y agoNo to the first, yes to the second. Podman has a daemon mode that works like like the Docker daemon, no systemd necessary.
- keeperofdakeys 2y ago> Podman has a daemon mode ... Can you provide any documentation about that?
- stryan 2y agoThey're probably referring to the podman.socket, which isn't quite like a daemon-mode but means it can emulate it pretty well. Unless there is some daemon mode I missed that got added, but I'd be rather surprised at that.
- Spivak 2y agoYep! https://docs.podman.io/en/latest/markdown/podman-system-service.1.html https://docs.podman.io/en/latest/markdown/podman-system-serv... In places where you're doing a `dnf install podman` all you typically need to do is start the service and then point either the podman cli or docker cli directly at it. In Fedora for example it's podman.service. I honestly prefer using the official docker cli when talking to podman.
- dminik 2y agoTo mirror some of the other comments here: I've had decent success in using podman for my local dev setup (postgres, redis, ...). I did run into one issue though. Rootless mode isn't supported (or at least easy to setup) when the user account is a member of an active directory (or whatever Linux equivalent my work laptop is running). Though root mode works, I can't use podman desktop and I have to sudo every command.
- pinoy420 2y agoWhy do people consistently like to make their lives harder in software engineering?
- passivegains 2y agoprogrammers ("developers," if you prefer) have trouble with "second order" thinking. we integrate X technology in Y way, maybe with some Z optimization, and that'll solve the problem. okay, but, like... will it? is there new maintenance stuff you've completely ignored? (I've noticed this is more common when maintenance is someone else's job.) is it completely new and none of us know about it so we get blindsided unless everything goes exactly right every time? do we get visibility into what it's doing? can we fix it when (not if, when) it breaks? can everyone work on it or is it impossible for anyone but the person who set it up? they're good at thinking up things that should fix the problem but less good at things that will. I'm a fan of cross-functional feature teams because others in the software engineering ecosystem like QA, systems people, ops, etc. tend not to have this problem. programmers are accountable to the other stakeholders up front, bad ideas are handled in real time, and- this is the most important part- everyone learns. (I won't say all systems people are cantankerous bastards... but the mistakes they've harangued me for are usually the mistakes I don't make twice.)
- morcus 2y agoPodman looks cool, is there any equivalent of Watchtower (https://containrrr.dev/watchtower/ https://containrrr.dev/watchtower/) for Podman?
- okl 2y agoGitHub issue for podman support, here: https://github.com/containrrr/watchtower/issues/1060 https://github.com/containrrr/watchtower/issues/1060
- xrisk 2y agoIt’s in-built: https://docs.podman.io/en/latest/markdown/podman-auto-update.1.html https://docs.podman.io/en/latest/markdown/podman-auto-update...
- vivzkestrel 2y agojust a pro tip "if it aint broken dont fix it" if you have a working docker file(s) do not migrate unless there is a ground breaking need
- natebc 2y agoPodman and Buildah consume Dockerfiles perfectly fine. Have you come across a scenario where Dockerfile contents were a concern?
- exceptione 2y agoSecurity might be such a need, but that depends on how important that is for you. On top, docker auto-fiddles with your firewall.
- toprerules 2y agoJust want to say everyone should be using podman. Its architecture is way more sane and integrates with Linux on a far more basic level (a regular process that can be started via systemd, etc. instead of a root daemon. Run it as root to get privileged containers). They've also built an incredible ecosystem around podman itself. Red Hat has been absolutely cooking with containers recently.
- user3939382 2y agoUntil it’s supported by AWS ECS it’s not relevant for me since that’s what my container builds are for.
- dharmab 2y agoImages built by Podman can be run by Docker and vice versa.
- mati365 2y agoSystemd .container services (Quadlet) are excellent. I used them to set up multiple smaller sites without any issues. Containers work just like regular systemd services. I created a small Ansible template to demonstrate how simple yet powerful this solution is. GH: https://github.com/Mati365/hetzner-podman-bunjs-deploy https://github.com/Mati365/hetzner-podman-bunjs-deploy
- throwaway984393 2y ago[dead]
- edwinjones 2y agoI agree. I have been using it as a drop in docker replacement alongside podman compose via aliases for years now and I often just forget I am not using docker. The only time it bit me recently is when some scripts were looking for containers with docker specific labels and I had to figure out why they failed only for me.
- koakuma-chan 2y agoWhat are the benefits of using Podman and not Docker?
- JamesSwift 2y agoI've not looked into podman but this reminded me that I miss rkt. Anyone with experience in rkt and podman able to give me an overview of how they currently differ? I'm not a huge fan of how docker works, so I'd love an alternative.
- jchw 2y agoI went from rkt to podman. Podman is compatible with Docker, including the socket/API, but is similar to rkt in that it launches the container as a child when ran directly (versus Docker, which runs all containers and storage operations under the daemon). Podman also has integration with systemd[1] though it mostly just generates boilerplate for you, since it works a lot closer to how actual daemons work. (P.S.: You might want `--new` if you want a new container each time the unit starts.) Podman also supports running in "rootless" mode, using kernel.unprivileged_userns_clone and subuid/subgids for the sandboxing and slirp4netns for the networking. This obviously isn't exactly the same as rootful networking, but it works well enough for 99% of the use cases. If you are running Linux, I think using Podman instead of Docker is generally a no-brainer. I think the way they've approached rootless support is a lot better than Docker and things "just work" more often than not. [1]: https://docs.podman.io/en/latest/markdown/podman-generate-systemd.1.html https://docs.podman.io/en/latest/markdown/podman-generate-sy...
- deskamess 2y agoWhat's the podman UX/story on Windows if anyone is using it? Say for Server 2022 (prod) and Win 11 Pro (dev). Does one prefer using WSL2 or Hyper-V as the machine provider? From what I understand, podman provides the container engine natively so nothing additional is required. Do container runtimes like containerd only come into play when using kubernetes? Not a windows specific question, but is there a reason to pick a podman native container vs one in a k8s context. I understand podman supports k8s as well. Other info: No current containers (docker or k8s) are in play. Thanks in advance.
- woodrowbarlow 2y agoon windows, rancher desktop + podman offers a similar experience to docker desktop.
- Nezteb 2y agoProtip: if you want to use Podman (or Podman Desktop) with Docker Compose compatibility, you'll have a better time installing podman-compose [1] and setting up your env like so: alias docker=podman # If you want to still use Docker Compose # export PODMAN_COMPOSE_PROVIDER=docker-compose # On macOS: `brew install podman-compose` export PODMAN_COMPOSE_PROVIDER=podman-compose export PODMAN_COMPOSE_WARNING_LOGS=false Most of my initial issues transitioning to Podman were actually just Docker (and Docker Desktop) issues. Quadlets are great and Podman has a tool called podlet [2] for converting Docker Compose files to Quadlets. I prefer using a tool like kompose [3] to turn my Docker Compose files into Kubernetes manifests. Then I can use Podman's Kubernetes integration (with some tweaks for port forwarding [4]) to replace Docker Compose altogether! [1] https://github.com/containers/podman-compose https://github.com/containers/podman-compose [2] https://github.com/containers/podlet https://github.com/containers/podlet [3] https://github.com/kubernetes/kompose https://github.com/kubernetes/kompose [4] https://kompose.io/user-guide/#komposecontrollerportexpose https://kompose.io/user-guide/#komposecontrollerportexpose
- pydry 2y agopodman compose is really bad
- akvadrako 2y agoIndeed, it has a lot of limitations. It's better to use docker compose with a podman socket.
- Nezteb 2y agoInteresting; I have yet to run into any issues with it. Teams I work with mostly use it for local development/testing and do actual deploys using Kubernetes, so we don't use Docker Compose for deployments that utilize features unavailable in Podman Compose. I'll try to do some more testing between the two and edit my original comment with my findings!
- pydry 2y agoOr just use docker until podman compose gets fixed. After all the whole point was supposed to be that it didnt need a daemon.
- DrNosferatu 2y agoWhat about Singularity? And while we’re at it, what’s your favorite non-sudo Docker alternative? And why?
- DrNosferatu 2y ago…or Apptainer?
- rubenv 2y agoOnly thing I really miss is good Podman support in Skaffold.
- powerhugs 2y agoI went with podman in 2020 when docker acted out last time and haven't looked back since.