this post was submitted on 08 Jun 2024
20 points (95.5% liked)

Selfhosted

40296 readers
322 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
 

Hi everyone,

This would seem to be a basic question (I've been on this for a few hours and can't seem to get it working).

This is my file for my pod:

$ cat backup.pod

[Unit]
Description=backup pod

[Pod]
Network=slirp4netns:port_handler=slirp4netns
PodmanArgs=--userns=auto:size=10000
PodName=backup

And this is the file for my container which is supposed to be part of the pod:

$ cat backup.container

[Unit]
Description=backup container

[Container]
Image=docker.io/debian/debian:latest
ContainerName=backup-container
Entrypoint=/bin/bash
Exec=/bin/bash -c "apt-get update -y && apt-get upgrade -y && apt-get install rclone vim -y && exec bash"
Pod=backup
GlobalArgs=-d -t

[Service]
Restart=always

[Install]
# Start by default on boot
WantedBy=multi-user.target default.target
  1. Podman's systemd-generator doesn't seem to create any service file for backup.pod in /run/user/$(id -u user). I do see a service file for backup.container, backup.service.
  2. Regardless, systemctl start backup.service errors out anyway.

I'm unable to understand how to use quadlet from the documentation. AFAIK I did everything they asked (https://docs.podman.io/en/latest/markdown/podman-systemd.unit.5.html).

The primary reason why I tried this was because I couldn't figure out how to create a pod using compose.yaml either. If someone has answers to these questions, they would be much appreciated!

Thanks!

all 7 comments
sorted by: hot top controversial new old
[–] poVoq@slrpnk.net 7 points 5 months ago* (last edited 5 months ago) (2 children)

First of all ensure you are on Podman version 5, as otherwise the .pod files will not work as it was just very recently added.

Then it should be Pod=backup.pod in the container file.

And AFAIK the .pod file also needs an section like this:

[Install]
# Start by default on boot
WantedBy=multi-user.target default.target

After a systemctl daemon-reload the corresponding .service file will be called backup-pod.service.

If it fails to start you can do a journalctl -e -u backup-pod.service to see the error message.

[–] just_another_person@lemmy.world 4 points 5 months ago

This is the most likely issue. Log output is a must, btw.

[–] MigratingtoLemmy@lemmy.world 1 points 5 months ago (2 children)

Apologies for not answering earlier. I have since switched over to podman generate kube and podman play kube for managing my podman infrastructure. This plays in well with my plans since I can't be dependent on systemd going forward. Thank you for your help.

With that said, I wanted to ask another question: when I try to run a container with podman run debian, it automatically pulls the debian container without a problem, however how is it that when I type podman pull docker.io/debian/debian it requires auth?

[–] markstos@lemmy.world 2 points 5 months ago

Exactly what is the auto prompt you see?

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

Pretty sure that the registry path for official images is "library" (at least it used to be). So it should be "docker.io/library/debian", though I can't double check at the moment.

[–] MigratingtoLemmy@lemmy.world 2 points 5 months ago

You're right, except the problem was that I was on an old version of Podman (Debian problems lol) where Quadlet wasn't even available