I’m trying to get podman-auto-update working on my Oracle Linux 9 VM, but no matter what I do, I keep seeing pod has no infra container: no such container
for every container when I update. I’ve done this on Ubuntu and Debian easily, but it’s my first time on Oracle Linux (aarch64) VM. I’ve done all the simple steps, like adding io.containers.autoupdate: "registry"
to each service. I’ve started and enabled the podman-auto-update.timer
service. I made a folder ~/.config/systemd/user
for unit files and ~/.config/containers/systemd
for the quadlets (I’ll explain later).
Here’s what I’ve tried:
- I used a
docker-compose.yaml
andpodman-compose
to start containers. Then, I made unit files withpodman generate systemd --new --name --files "${container_name}"
. I enabled and started them withsystemctl —user enable --now container-container-name.service
and triedpodman auto-update —dry-run
, but I got the error.
- Starting with running containers again, I tried using the podlet tool to make
.container
files and put them in the right place. I reloaded the daemon withsystemctl —user daemon-reload
and started the services withsystemctl —user start container.service
. But, trying podman auto-update gave me errors again. - I used
podman-compose
‘s built-inpodman-compose systemd -a register
to make unit files. I started the services using the project name and ran podman auto-update, only to face the same errors again.
I only recently moved to podman from docker, and from what I’ve read, it should work. Maybe there’s something I’m overlooking on this OS that makes it act differently than on Debian systems. However, Oracle’s own website has guides that cover the same steps I’ve followed. But now, I’m not sure what to do next.
Here are some code examples that might help:
podman ps and pod ps
# podman pod ps
POD ID NAME STATUS CREATED INFRA ID # OF CONTAINERS
704df5a222a8 pod_prometheus Running 56 seconds ago 3
# podman ps
CONTAINER ID NAMES CREATED AT NETWORKS STATE RUNNING FOR
dde4a4903a74 prometheus 2024-07-02 14:46:53.18294316 +0000 UTC prometheus_default running About a minute ago
f3971b55ca48 node-exporter 2024-07-02 14:46:53.568501168 +0000 UTC prometheus_default running About a minute ago
f8a671a27bae fail2ban-exporter 2024-07-02 14:46:53.833046775 +0000 UTC prometheus_default running About a minute ago
docker-compose.yaml
volumes:
prometheus_data:
external: true
services:
prometheus:
image: docker.io/prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml:Z
- "prometheus_data:/prometheus"
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yml"
labels:
io.containers.autoupdate: "registry"
node_exporter:
image: quay.io/prometheus/node-exporter:latest
container_name: node-exporter
command:
- "--path.rootfs=/host"
pid: host
restart: unless-stopped
volumes:
- "/:/host:ro,rslave"
labels:
io.containers.autoupdate: "registry"
fail2ban:
image: registry.gitlab.com/hectorjsmith/fail2ban-prometheus-exporter:latest
container_name: fail2ban-exporter
volumes:
- /var/run/fail2ban/:/var/run/fail2ban:Z
restart: unless-stopped
ports:
- "9191:9191"
pid: host
labels:
io.containers.autoupdate: "registry"
podman version
Client: Podman Engine
Version: 4.9.4-rhel
API Version: 4.9.4-rhel
Go Version: go1.21.10 (Red Hat 1.21.10-1.el9_4)
Built: Tue Jun 11 22:06:37 2024
OS/Arch: linux/arm64
example .container file
[Container]
AutoUpdate=registry
ContainerName=prometheus
Exec='--config.file=/etc/prometheus/prometheus.yml'
Image=docker.io/prom/prometheus:latest
Label=io.podman.compose.config-hash=4cefa381d4d552f6c8f072986156a7dd249e5e4566e065c9f1f5048063348bad io.podman.compose.project=prometheus io.podman.compose.version=1.2.0 [email protected] com.docker.compose.project=prometheus com.docker.compose.project.working_dir=/home/tbryant/DEV/docker-apps/Monitoring/Active/prometheus/homelab-oci03 com.docker.compose.project.config_files=docker-compose.yaml com.docker.compose.container-number=1 com.docker.compose.service=prometheus
Network=prometheus_default
PodmanArgs=--network-alias prometheus --pod pod_prometheus
PublishPort=9090:9090
Volume=/home/tbryant/DEV/docker-apps/Monitoring/Active/prometheus/homelab-oci03/prometheus.yaml:/etc/prometheus/prometheus.yml:Z
Volume=prometheus_data:/prometheus
[Service]
Restart=always
[Install]
WantedBy=default.target
example unit file
# container-prometheus.service
# autogenerated by Podman 4.9.4-rhel
# Tue Jul 2 14:46:16 GMT 2024
[Unit]
Description=Podman container-prometheus.service
Documentation=man:podman-generate-systemd(1)
Wants=network-online.target
After=network-online.target
RequiresMountsFor=%t/containers
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=always
TimeoutStopSec=70
ExecStart=/usr/bin/podman run
--cidfile=%t/%n.ctr-id
--cgroups=no-conmon
--rm
--sdnotify=conmon
--replace
--name=prometheus
-d
--pod=pod_prometheus
--label io.containers.autoupdate=registry
--label io.podman.compose.config-hash=4cefa381d4d552f6c8f072986156a7dd249e5e4566e065c9f1f5048063348bad
--label io.podman.compose.project=prometheus
--label io.podman.compose.version=1.2.0
--label [email protected]
--label com.docker.compose.project=prometheus
--label com.docker.compose.project.working_dir=/home/tbryant/DEV/docker-apps/Monitoring/Active/prometheus/homelab-oci03
--label com.docker.compose.project.config_files=docker-compose.yaml
--label com.docker.compose.container-number=1
--label com.docker.compose.service=prometheus
-v /home/tbryant/DEV/docker-apps/Monitoring/Active/prometheus/homelab-oci03/prometheus.yaml:/etc/prometheus/prometheus.yml:Z
-v prometheus_data:/prometheus
--network=prometheus_default
--network-alias=prometheus
-p 9090:9090 docker.io/prom/prometheus:latest
--config.file=/etc/prometheus/prometheus.yml
ExecStop=/usr/bin/podman stop
--ignore -t 10
--cidfile=%t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm
-f
--ignore -t 10
--cidfile=%t/%n.ctr-id
Type=notify
NotifyAccess=all
[Install]
WantedBy=default.target