it's not always sunny with podman

I am moving from docker to podman and selinux because I thought that podman is more secure and hence, the future. I thought the transition will be somewhat seamless. I even prepaired containers but once I migrated I still ran into issues.

minor issue: it’s podman-compose instead of podman compose. The hyphen feels like a step back because we moved from docker-compose to docker compose. But thT’s not a real issue.

podman does not autostart containers after boot. You have to manually start them, or write a start script. Or create a systemd unit for each of them.

Spinning up fresh services works most of the time but using old services that worked great with docker are a pain. I am wasting minutes after minutes because I struggle with permissions and other weird issues.

podman can’t use lower number ports such that you have to map the ports outside of the machine and forward them properly.

Documentation and tutorials are “all” for docker. Github issues are “all” for docker. There isn’t a lot of information floating around.

I’m still not done and I really wonder why I should move forward and not go back to docker. Painful experience so far. linuxhandbook.com/docker-vs-podman/ and following pages helped me a lot to get rid of my frustration with podman.

possiblylinux127,

Podman compose isn’t really usable for me

Helix,

it’s podman-compose instead of podman compose

Don’t use it, it’s not a full replacement. The script is barely maintained and not really “official”.

I think before switching from Docker to Podman you should first get proficient in Docker, because Podman is not for beginners (yet).

Vent,

Podman is purposefully built to rely on systemd for running containers at startup. It ties in with the daemonless and rootless conventions. It’s also nice because systemd is already highly integrated with the rest of the OS, so doing things like making a container start up after a drive is mounted is trivial.

Podman has a command to generate systemd files for your containers, which you can then use immediately or make some minor tweaks to your liking.

I use podman for my homelab and enjoy it. I like the extra security and that it relies on standard linux systems like systemd and user permissions. It forces me to learn more about linux and things that apply to more than just podman. You can avoid a lot of trouble by running the containers as root and using network=host, but that takes away security and the fun of learning.

xor,

Ooh I didn’t know about the systemd integration, that actually sounds like a really smart approach.

To be honest, until right now I’d pretty much written off podman as docker 2

Molecular0079,

You can avoid a lot of trouble by running the containers as root and using network=host

Root yes, but you can avoid network=host most of the time pretty easily. I am still struggling with going rootless myself tbh.

MigratingtoLemmy,

Almost all of your problems are because you aren’t running as root. These aren’t bugs. They seem like a pain because you’re transitioning from Docker which runs as root (which is ABSOLUTELY INCORRIGIBLE in my opinion).

SELinux is a different story though. Now that’s a hard to tame beast. Things go wrong easily if you don’t know what you’re doing.

I suggest researching more before jumping off into a new technology, you seem like you weren’t anticipating some of these problems which adds to the frustration.

sudneo,

You can run docker rootless too. On local machines running docker with root is a risk that for many is acceptable. On servers and publicly exposed hosts, rootless.

johanbcn,

podman does not autostart containers after boot. You have to manually start them, or write a start script. Or create a systemd unit for each of them.

I have not yet tried podman, but I know that podman-compose used to have an option to generate systemd units for your pods: docs.podman.io/…/podman-generate-systemd.1.html

Still, that option has been deprecated in favour of Podman Quadlet docs.podman.io/en/…/podman-systemd.unit.5.html

Molecular0079, (edited )

Your issues stem from going rootless. Podman Compose creates rootless containers and that may or may not be what you want. A lot more configuration needs to be done to get rootless containers working well for persistent services that use low ports, like enabling linger for specific users or enabling low ports for non-root users.

If you want the traditional Docker experience (which is rootful) and figure out the migration towards rootless later, I’d recommend the following:

  1. Install podman-docker. This provides a seamless Docker compatibility layer for podman, allowing you to even use regular docker commands that get translated behind the scenes into Podman.
  2. Install regular docker-compose. This will work via podman-docker and gives you the native docker compose experience.
  3. Enable podman.socket and podman-restart.service. First one socket-activates the central Podman daemon, second one restarts any podman containers with a restart-policy of always on boot.
  4. Run your docker-compose commands using sudo, so sudo docker-compose up -d etc. You can run this with sudo podman compose as well if you’re allergic to hyphenation. Podman allows both rootful and rootless containers and the way you choose is by running the commands with sudo or not.

This gets you to a very Docker-like experience and is what I am currently using to host my services. I do plan on getting familiar with rootless and systemd services and Kubernetes files, but I honestly haven’t had the time to figure all that out yet.

GravitySpoiled,

thank you!

qaz,

Enable podman.socket and podman-restart.service. First one socket-activates the central Podman daemon, second one restarts any podman containers with a restart-policy of always on boot.

Thanks, the last time I checked I was told that creating individual systemd services was the only viable solution and I ended up ditching podman because I didn’t think it was worth the hassle. I might try it again with your tips.

Molecular0079,

Definitely not necessary. If that was the case, it wouldn’t live up to it’s claims of being a transparent Docker replacement at all. I think you do need to use systemd if you want to go full rootless, but I haven’t tried it enough to make a solid call on that.

But yeah, with the above steps, I’ve moved seamlessly over to Podman for my self hosting stack and I’ve never looked back. It’s also great because I can take literally any Docker Compose I find on the Internet and it will most likely just work.

hperrin,

Regarding the low port number thing, that’s just a consequence of not running as root. By default, regular users can’t listen on ports below 1000.

lemmyvore,

1024

hperrin,

You are correct. I’m as bad as hard drive manufacturers.

qaz,

Well hard drive manufacturers are actually correct. A gigabyte (GB) is in base 10 and thus 1000 megabytes, not 1024. Gibibytes (GiB) are base 2 (hence “bi”) and thus 1024 mebibytes.

lemmyingly,

I know it’s technically correct but it still hurts a little inside to admit it each time.

I know the reason is because giga is an SI prefix but all the way through my education, 1 GB was taught to be 1024 MB, so I always want to use this instead of what is correct.

To be fair, the tech industry has been naughty with things like this. I know of two. I wonder how many others there are?

I believe that:

  • The style of characters a user can choose is called a typeface. I think every piece of software calls it a font. I remember hearing it came from Apple/Steve Jobs.
  • I believe the use of setup is incorrect. Setup is a noun, so it refers to an existing configuration. It tends to be used when running an OS or program for the first time though, which I believe set up is the correct term. Set up is an adjective and refers to the act of creating the configuration.

I’ve wondered if these were done due to screen space constraints or aesthetics.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • linux@lemmy.ml
  • fightinggames
  • All magazines