this post was submitted on 02 Feb 2024
15 points (94.1% liked)

Selfhosted

40329 readers
395 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
 

I'm new to Podman and so far have been completely frustrated by it.
I don't know if the issue is with the container or Podman since there are just no logs.

I'm trying to run Stirling-PDF, using this command:

podman run -d
-p 8080:8080
-v /location/of/trainingData:/usr/share/tesseract-ocr/5/tessdata
-v /location/of/extraConfigs:/configs
-v /location/of/logs:/logs
-e DOCKER_ENABLE_SECURITY=false
--name stirling-pdf
frooodle/s-pdf:latest

With Docker, I have no issue running the this container. Under Podman the container immediately exits without logs - podman logs stirling-pdf shows nothing.

The same thing happens running the same command with sudo or without sudo but using --rootful. I've also tried removing '-e DOCKER_ENABLE_SECURITY=false ' since it's very Docker specific.

I can run podman run -dt --name webserver -p 8081:80 quay.io/libpod/banner with no issues, so is this something incompatible with the container?

I feel like I'm missing something obvious - like where are the logs?

I'm running on OpenSUSE-Tumbleweed, Podman version 4.9.0

top 19 comments
sorted by: hot top controversial new old
[–] poVoq@slrpnk.net 9 points 9 months ago (2 children)

You need to tell Podman which container repo to use. Contrary to Docker it doesn't just assume Dockerhub. Try with docker.io/frooodle/s-pdf:latest

If you run the Podman container via the systemd integration it will have logs like any other service.

[–] bravemonkey@lemmy.ca 2 points 9 months ago

Ah, looks like I should have used journalctl -b | grep stirling-pdf

[–] bravemonkey@lemmy.ca 1 points 9 months ago

Thanks, docker.io/frooodle/s-pdf:latest was the only repository that would download it from the options it gave me. I'm working through the other suggestions as well. journalctl isn't giving me anything when I try grep with stirling, podman or s-pdf. It's 100% likely I'm not using journalctl properly either.

[–] ubergeek77@lemmy.ubergeek77.chat 4 points 9 months ago* (last edited 9 months ago) (2 children)

You are giving it the -d flag. -d means "detached." There are logs, you are just preventing yourself from seeing them.

Replace the -d with an -i (for interactive) and try again.

Have you completed the podman rootless setup in order to be able to use it? You may need to edit /etc/subuid and /etc/subgid to get containers to run:

https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md#etcsubuid-and-etcsubgid-configuration

More than likely, this might have something to do with podman being unprivileged, and this wanting to bind to port 80 in the container (a privileged port). You may need to specify a --userns flag to podman.

Running in interactive mode will give you the logs you want and will hopefully point you in the right direction.

[–] bravemonkey@lemmy.ca 1 points 9 months ago

I didn't know enough to try running it interactively - that was a great suggestion and showed many access denied errors trying to access a log file path, so thanks for that suggestion.

[–] bravemonkey@lemmy.ca 1 points 9 months ago

Interesting, it runs if I remove the mount points. It's binding to port 8080, so nothing to do with privileged ports here. I'll need to look into the subuid and subgid edits - I read the docs for those and understood them to be for multiple users on the same machine running the same container, didn't realize it was for all users including my own but that makes sense. Thanks for the direction!

[–] faethon@lemmy.world 2 points 9 months ago (2 children)

just curious; why would you like to use podman over docker? I have a lot of docker containers running, wondering if I should switch to podman.

[–] vojel@discuss.tchncs.de 5 points 9 months ago (1 children)

No daemon needed, better security because of rootless approach, but well docker also runs rootless nowadays. Podman came up from frustration from Red Hat over docker, that’s why they developed their own thing. Afaik it is nearly full compatible and can be used as a drop in replacement for docker.

[–] faethon@lemmy.world 1 points 9 months ago (1 children)

interesting! So I should be able to throw my docker-compose yamls directly at Podman and be good to go?

[–] poVoq@slrpnk.net 2 points 9 months ago (1 children)

No, docker-compose is where Podman differs. There are some 3rd party attempts to make it compatible via podman-compose, but most people agree that the Systemd integration of Podman is better anyways and if you really need advanced orchestration then you can use K8 helmcharts with Podman.

[–] vojel@discuss.tchncs.de 2 points 9 months ago (1 children)
[–] poVoq@slrpnk.net 1 points 9 months ago (1 children)

Is that a podman-desktop exclusive feature?

[–] vojel@discuss.tchncs.de 1 points 9 months ago

Dont think so. Desktop application relies on podman

[–] bravemonkey@lemmy.ca 1 points 9 months ago

A couple of reasons - I switched from Pop! OS to OpenSUSE Tumbleweed, and the Docker version in the repository is 24.07 compared to 25.02 (the current version of Docker) with the official Docker site only supporting SLES on s390x, not Tumbleweed on x86_64. The main reason though is that it can run without root which is appealing; apparently I have a lot to learn on setting that up. The glib statements of 'drop in replacement' that I"ve seen isn't quite accurate apparently outside of the commandline options.

[–] vojel@discuss.tchncs.de 1 points 9 months ago (1 children)

What exit code shows when you execute podman ps -a?

[–] bravemonkey@lemmy.ca 1 points 9 months ago

Thanks - this shows exited (1). Running in foreground mode from another suggestion shows the same access denied and file not found error repeatedly - 'Suppressed: java.io.FileNotFoundException: logs/info.log (Permission denied). Looks like I don't have podman configured correctly, going to work through that.

[–] possiblylinux127@lemmy.zip 1 points 9 months ago
podman logs [container id]
[–] atzanteol@sh.itjust.works 1 points 9 months ago (1 children)

Does it run in the foreground? It works for me if I run podman run -it --rm docker.io/frooodle/s-pdf:latest. Maybe it's something with the application itself and some data in those mount points?

[–] bravemonkey@lemmy.ca 2 points 9 months ago

Looks like it is the mount points; if I remove those it runs. Going to follow @ubergeek77's suggestion. (Does tagging with @ work on Lemmy?)