this post was submitted on 26 Sep 2023
77 points (89.7% liked)

Selfhosted

40137 readers
612 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] hottari@lemmy.ml 37 points 1 year ago (3 children)

Any time I always read how to accomplish something in podman-land , the action takes like 5 extra steps compared to docker, is probably an experimental feature that's not supported and is always from a non-official source or some random blog.

[–] oranki@sopuli.xyz 24 points 1 year ago (1 children)

In my limited experience, when Podman seems more complicated than Docker, it's because the Docker daemon runs as root and can by default do stuff Podman can't without explicitly giving it permission to do so.

99% of the stuff self-hosters run on regular rootful Docker can run with no issues using rootless Podman.

Rootless Docker is an option, but my understanding is most people don't bother with it. Whereas with Podman it's the default.

Docker is good, Podman is good. It's like comparing distros, different tools for roughly the same job.

Pods are a really powerful feature though.

[–] hottari@lemmy.ml 7 points 1 year ago (1 children)

In my limited experience, when Podman seems more complicated than Docker, it’s because the Docker daemon runs as root and can by default do stuff Podman can’t without explicitly giving it permission to do so.

Can't argue with that. There's some truth to this.

99% of the stuff self-hosters run on regular rootful Docker can run with no issues using rootless Podman.

If this figure was even close to being remotely true, everyone would have moved to rootless containers by now.

Rootless Docker is an option, but my understanding is most people don’t bother with it. Whereas with Podman it’s the default.

These two share the same set of problems. People don't want to downgrade from a "working" docker to a rootless "safer" docker that comes with more usability headaches.

Docker is good, Podman is good. It’s like comparing distros, different tools for roughly the same job.

Not really. The two are really different underneath but on surface they may look like they are overlapping solutions to the untrained eye.

Pods are a really powerful feature though.

Last time I was giving podman a try, I didn't find anything really special about pods. Maybe it just didn't click for me or I was not the intended audience.

[–] oranki@sopuli.xyz 6 points 1 year ago (1 children)

on surface they may look like they are overlapping solutions to the untrained eye.

You'll need to elaborate on this, since AFAIK Podman is literally meant as a replacement for Docker. My untrained eye can't see what your trained eye can see under the surface.

[–] hottari@lemmy.ml 2 points 1 year ago (1 children)

The two are not hot-swappable solutions (as much as podman tries to act as a drop-in replacement for docker). Trying to replace one with the other after coming from extended use of either will immediately let you know of the stark differences between them.

[–] oranki@sopuli.xyz 5 points 1 year ago (1 children)

Perhaps I misunderstand the words "overlapping" and "hot-swappable" in this case, I'm not a native english speaker. To my knowledge they're not the same thing.

In my opinion wanting to run an extra service as root to be able to e.g. serve a webapp on an unprivileged port is just strange. But I've been using Podman for quite some time. Using Docker after Podman is a real pain, I'll give you that.

[–] hottari@lemmy.ml 1 points 1 year ago* (last edited 1 year ago)

I am not a native english speaker either but it seems like you are trying to understand those two words outside of their context as used in the sentences I've replied. They are only meant to be understood in the context of the conversation. In this case, the two terms mean almost interchangable. Look up the meaning of both words and try to apply them as previously used.

In my opinion wanting to run an extra service as root to be able to e.g. serve a webapp on an unprivileged port is just strange.

Often times we don't get to choose the software solutions that we will eventually use, they choose us. Colloquially speaking.

[–] dandroid@dandroid.app 18 points 1 year ago (1 children)

I use podman because it's more secure. I'm willing to put in the extra effort so that all my services aren't running as root. If it turns out a vulnerability is discovered in lemmy tomorrow that allows people to access my server through my lemmy container, the attacker will only have access to a dummy account that hosts my containers. Yes, they could stop all my containers, but they can't delete the volumes or any other data on my server.

[–] hottari@lemmy.ml 6 points 1 year ago (1 children)

Podman might have a "more secure" design but you can run the docker daemon as rootless. Podman itself is not immune to vulnerabilities and will not solve all your security problems.

[–] dandroid@dandroid.app 12 points 1 year ago (2 children)

Don't let perfection be the enemy of good. Security is not all or nothing. Reducing the attack surface is still important.

Can you elaborate on running docker daemon as rootless? It's my understanding that you can add your account to a group to access the docker daemon rootless, but the containers are still running as root, as the daemon itself raises the access to root.

[–] icedterminal@lemmy.world 2 points 1 year ago

but the containers are still running as root, as the daemon itself raises the access to root.

No. The daemon can run without root, as such the containers don't have root. My docker install doesn't have root access. None of my stacks / containers need any root access tbh. I don't have any troubles with deplyong stuff.

https://docs.docker.com/engine/security/rootless/

[–] hottari@lemmy.ml -4 points 1 year ago (1 children)

Not sure relying on podman alone as a security tool might be advisable. Podman is a container technology first, security is not the main goal.

Read more about rootless docker here.

[–] dandroid@dandroid.app 7 points 1 year ago (1 children)

I never said I was relying on it alone. Not sure why you think that.

That's a great link. Thank you for sharing. It's good that docker supports this functionality now.

[–] hottari@lemmy.ml -4 points 1 year ago (1 children)

I never said I was relying on it alone. Not sure why you think that.

....

...all my services aren’t running as root.

If it turns out a vulnerability is discovered in lemmy tomorrow that allows people to access my server through my lemmy container, the attacker will only have access to a dummy account that hosts my containers.

This was your argument according to you for why you think podman is more secure (than docker I presume). Seemed to imply rootless podman will save you from an attacker. I was simply disproving the flawed notion.

[–] BlueBockser@programming.dev 0 points 1 year ago (1 children)

I think you're interpreting too much. Security is about layers and making it harder for attackers, and that's exactly what using a non-root user does.

In that scenario, the attacker needs to find and exploit another vulnerability to gain root access, which takes time - time which the attacker might not be willing to spend and time which you can use to respond.

[–] hottari@lemmy.ml -3 points 1 year ago (1 children)

You don't know enough about security to lecture me. The kernel has before/continues to suffer(ed) from successful root shell exploits, particularly in this case via unprivileged userns. Something podman or even rootless docker can't do anything about.

[–] BlueBockser@programming.dev -1 points 1 year ago (2 children)

Funny how you claim to know so much about security but can't even seem to comprehend my comment. I know root shell exploits exist, that's why I wrote that it takes additional time to get root access, not that it's impossible. And that's still a security improvement because it's an additional hurdle for the adversary.

[–] apigban@lemmy.dbzer0.com 2 points 1 year ago

the person you are replying to either lacks comprehension or maybe just wants to be argumentative and doesn't want to comprehend.

[–] hottari@lemmy.ml -3 points 1 year ago (1 children)

Containers cannot be viewed as security tools. They suffer from poor isolation and inadequate and some cases non-existent sandboxing. All these are proven security essentials. You would know about them if you knew anything about (defensive) security!

[–] BlueBockser@programming.dev 1 points 1 year ago

Once again, you're going off on an unrelated tangent. If you don't want to listen, I can't help you. We're done here.

[–] poVoq 8 points 1 year ago (1 children)

If you make something with Podman yourself it is actually less work most of the time (the OP tutorial is incredibly convoluted for no reason).

But sure, if someone else did all the work for you and you just need to download the docker-compose file and run it, that is of course less work for you. But that is just a result of Docker's relative popularity compared to Podman.

[–] hottari@lemmy.ml -1 points 1 year ago (3 children)

If you make something with Podman yourself it is actually less work most of the time (the OP tutorial is incredibly convoluted for no reason).

Doubt.

OP's guide is simply describing how podman is designed to work. With systemd unit files for managing services.

But sure, if someone else did all the work for you and you just need to download the docker-compose file and run it, that is of course less work for you. But that is just a result of Docker’s relative popularity compared to Podman.

Why re-invent the wheel?

[–] anyhow2503@lemmy.world 5 points 1 year ago (1 children)

Doubt.

Cool attitude. In my experience, most docker/docker-compose setups will work transparently with podman/podman-compose. If you want to tighten security, lock down ressource access, run rootless (daemon and inside the container), integrate with SELinux, then you might need to put in extra-work, just like you would if you used docker.

Why re-invent the wheel?

They aren't. Podman is mostly just a docker-compatible CLI wrapper around an existing OCI runtime (runc by default). It also lets you manage pods and export k8s yaml, which is arguably the more important industry standard at this point. Podman was also completely usable in rootless mode way before Docker support for that was on the table, which was the main reason I switched years ago. Podman development effort also yielded buildah, which is a godsend if you want to build container images in a containerized environment, without granting docker socket access (which is a security nightmare) or using some docker in docker scenario (which is just a nightmare in general).

[–] hottari@lemmy.ml -1 points 1 year ago (1 children)

Cool attitude. In my experience, most docker/docker-compose setups will work transparently with podman/podman-compose. If you want to tighten security, lock down ressource access, run rootless (daemon and inside the container), integrate with SELinux, then you might need to put in extra-work, just like you would if you used docker.

The whole point of docker/compose is you don't have to do all those things to get started.

Why re-invent the wheel? They aren’t.

This whole conversation is about re-inventing the wheel called docker-compose with quadlet. Or whatever podman will come up with next as a "drop-in" replacement.

[–] Molecular0079@lemmy.world 3 points 1 year ago (1 children)

Quadlets were never meant as a drop-in replacement. The docker-compose tool works just fine on top of podman though. I personally use it to setup Jellyfin and Nextcloud.

[–] hottari@lemmy.ml -3 points 1 year ago (1 children)

That's why I used double quotes around the word drop-in (supposed to be a play on the whole preposition of podman being touted as a drop-in replacement to docker).

Even so, what is really the use of Quadlets if docker-compose works just fine? Is it supposed to be just a backup alternative to compose just incase something catastrophic were to ever happen to docker-compose? Why create two ways to do one thing? Seems rather confusing and misplaced.

[–] Molecular0079@lemmy.world 4 points 1 year ago

I prefer the simplicity of docker-compose on top of podman myself for my self-hosting needs, but I imagine systemd integration to be advantageous in many ways. You can have your containers activated by a socket. You can configure your containers so that they depend on certain system services being up or available, giving you more fine grained control over your start up process. That's just off-the-top of my head as I have very limited knowledge of this aspect of podman, but I don't think it's meant as a backup. It just provides a more flexible solution for certain deployment scenarios, in exchange for more configuration complexity of course.

[–] Molecular0079@lemmy.world 4 points 1 year ago (1 children)

I think he's referring to the fact that it's mixed in with a bunch of CoreOS setup stuff. I also thought the same of this tutorial. I use podman myself but I have no interest in CoreOS. It was a bit difficult trying to extract just the podman related stuff out of that tutorial.

[–] hottari@lemmy.ml 1 points 1 year ago

Fair enough. You are right.

[–] poVoq 4 points 1 year ago* (last edited 1 year ago) (1 children)

Yes, but only 10% or so of the article is about what you actually need to know to use Quadlet and the rest is some convoluted mess that I don't know why the author bothered with sharing that.

[–] tenchiken@lemmy.dbzer0.com 1 points 1 year ago

Major typically writes these as much for his own notes / thoughts as anything. Having some insight into how he got where he is in the process can help some others learn. I've learned tons from the guy.

I've known him over 15 years, and he always has written posts for himself first. This isn't a bad way, just maybe not the simplest for experienced folks. Laying out your own thoughts along the path can help later when you wonder why you did X instead of Y.