(no title)
tekeous | 2 years ago
Then they removed that in favor of Quadlet. Now in order to do a single container I can do a unit file, but for a pod, I need to use a Kubernetes cluster definition.
Plus, unlike Docker their containers bow to SELinux definitions, so I have repeatedly struggled with containers unable to access mapped directories.
So what is it, Podman? Should I just use Kubernetes? Should I just make dedicated directories for everything instead of mapping logical places for things?
lolinder|2 years ago
To enable the feature:
To register a systemd unit: Updating looks like this: ($PROJECT_NAME is usually the directory name.)Source code for the feature is here if you care to inspect it:
https://github.com/containers/podman-compose/blob/f6dbce3618...
Admittedly, I'm still on podman 4.3.1, but I don't see any reason why this would stop working in later versions of podman.
ape4|2 years ago
kccqzy|2 years ago
notso411|2 years ago
bonzini|2 years ago
That's a bug in docker. If your system isn't configured for SELinux, disable it.
Also the systemd files generated by podman-generate-systemd are just executing "podman start containername", you can write them on your own easily but (unlike e.g. docker-composr) the containers are black boxes pretty much.
The advantage of quadlet is that the definition of the container is declared in the .container file; before I used to write the podman run command line manually in a handwritten systemd unit, and quadlet is a big improvement in that respect and can be an alternative to docker-compose (with advantages and disadvantages).
INTPenis|2 years ago
I feel obligated to say that you should set it to permissive mode, never disable SElinux.
bravetraveler|2 years ago
I keep forgetting this transition happened until I try to 'podman generate systemd [...]'
This is rare because I wrote an Ansible role to do this in a way that feels nice.
Anyway, it really feels like podman lost the mark. I've already subscribed to the unit file maintenance/relationship planning thing. Just let me use the generator. I don't care about Quadlets or how they might be better.
emerongi|2 years ago
Add the following to containers.conf if you don't want to deal with it:
If you don't like podman's default security level, there is usually a way to turn things off.sph|2 years ago
Cyph0n|2 years ago
https://github.com/aksiksi/compose2nix
jay-aye-see-key|2 years ago
Arion can wrap docker-compose and run as a project or part of a nixos config. Did you come across Arion before creating this, and have you compared them?
I had a brief look through your examples and it doesn’t look like compose2nix implements docker-compose’s network per compose file. Is this something you want to add?
BossingAround|2 years ago
Isn't that great? You want SELinux if you deploy containers on prod.
> I have repeatedly struggled with containers unable to access mapped directories.
Use the `z` or `Z` flag, e.g. `podman run -v mydir:podman_dir:z nginx` to get SELinux labels updated automatically (and temporarily) by podman.
freedomben|2 years ago
rcarmo|2 years ago
hinkley|2 years ago
madspindel|2 years ago
runiq|2 years ago
starttoaster|2 years ago
If you're talking about a production system for any business larger than a 10 person tech startup; yeah, probably. Alternatively there's Docker Swarm and Hashicorp Nomad. Though Swarm is not nearly as flexible, it's just easy to use. And Nomad... well, let's just say I've been paying closer attention to Hashicorp's build processes in their open source repos like Packer and Vault as of late and they do some stuff that seems shady to me so use at your own risk.
asmor|2 years ago
feels like a lot more cruft than quadlets to me though.
cpuguy83|2 years ago
Mapping directories from the host requires that you change selinux labels on those files so that the container process can access the files. That's just how selinux works.
unknown|2 years ago
[deleted]
INTPenis|2 years ago
It's just a simplified layer ontop of those old systemd units.