惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
aimingoo的专栏
aimingoo的专栏
Vercel News
Vercel News
U
Unit 42
L
LangChain Blog
J
Java Code Geeks
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
I
InfoQ
P
Proofpoint News Feed
D
DataBreaches.Net
Martin Fowler
Martin Fowler
H
Help Net Security
T
Tailwind CSS Blog
N
Netflix TechBlog - Medium
有赞技术团队
有赞技术团队
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
B
Blog RSS Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
B
Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Optional persistent data example:
Lyra · 2026-06-16 · via DEV Community

Lyra

If you’re still generating unit files with podman generate systemd, there’s a better path now: Quadlet.

In current Podman docs, podman generate systemd is marked deprecated (still available, but no new features), and Quadlet is the recommended approach.

This guide gives you a practical, reproducible setup for:

  • a rootless container managed by systemd
  • declarative .container files (instead of generated unit files)
  • safe image auto-updates with rollback support
  • basic observability and troubleshooting

Why switch to Quadlet?

podman generate systemd creates unit files from existing containers. That works, but it’s imperative and easy to drift.

Quadlet flips this into a declarative model:

  • you define desired state in .container, .network, .volume, etc.
  • systemd (via Podman’s generator) creates/updates corresponding .service units on daemon-reload
  • config is versionable and easier to review

Also, the Podman manual explicitly recommends Quadlet over podman generate systemd for systemd-managed workloads.


Prerequisites

  • Linux host with systemd and Podman installed
  • user-level systemd session available (systemctl --user ...)
  • outbound registry access (for pulling images)

Check Podman and cgroup mode:

podman --version
podman info --format '{{.Host.CgroupsVersion}}'

Quadlet requires cgroup v2.


Step 1) Create a rootless Quadlet file

For rootless units, place files under:

  • ~/.config/containers/systemd/ (recommended)

Create directories:

mkdir -p ~/.config/containers/systemd
mkdir -p ~/.config/containers/systemd/data/whoami

Now create ~/.config/containers/systemd/whoami.container:

[Unit]
Description=Traefik whoami (rootless Podman via Quadlet)
After=network-online.target
Wants=network-online.target

[Container]
Image=docker.io/traefik/whoami:v1.10
ContainerName=whoami
PublishPort=127.0.0.1:18080:80
# Optional persistent data example:
Volume=%h/.config/containers/systemd/data/whoami:/data:Z
# Enable automatic image updates via registry digest checks
AutoUpdate=registry

[Service]
Restart=always
RestartSec=5
# Give image pulls/builds enough time during startup
TimeoutStartSec=900

[Install]
WantedBy=default.target

Why bind to 127.0.0.1?

Publishing on loopback (127.0.0.1) keeps the app private to the host unless you intentionally front it with a reverse proxy.


Step 2) Reload systemd user daemon and start service

systemctl --user daemon-reload
systemctl --user start whoami.service
systemctl --user enable whoami.service

Check status and logs:

systemctl --user status whoami.service --no-pager
journalctl --user -u whoami.service -n 100 --no-pager
podman ps --filter name=whoami
curl -s http://127.0.0.1:18080


Step 3) Enable periodic auto-updates

Podman ships podman-auto-update.service and podman-auto-update.timer.
By default, the timer runs daily at midnight.

Enable for your user:

systemctl --user enable --now podman-auto-update.timer
systemctl --user list-timers | grep podman-auto-update

Run a dry-run check:

podman auto-update --dry-run

If an image digest changes and your container has AutoUpdate=registry, Podman pulls the new image and restarts the related systemd unit.


Step 4) Optional: expose through Caddy

If you want HTTPS and friendly hostnames, proxy your loopback service.

Minimal Caddyfile:

whoami.example.com {
    reverse_proxy 127.0.0.1:18080
}

Reload Caddy and test.


Operational notes that save headaches

  1. Use fully-qualified image names with AutoUpdate=registry (e.g., docker.io/..., quay.io/...).
  2. Raise TimeoutStartSec for images that may pull slowly.
  3. Use drop-ins (*.container.d/*.conf) for environment-specific overrides instead of editing the base file.

Troubleshooting quick list

If systemd says unit not found after creating .container:

systemctl --user daemon-reload
systemctl --user list-unit-files | grep whoami

Inspect generated units and generator behavior:

/usr/lib/systemd/system-generators/podman-system-generator --user --dryrun
systemd-analyze --user --generators=true verify whoami.service

If auto-updates do not trigger:

podman auto-update --dry-run
journalctl --user -u podman-auto-update.service -n 200 --no-pager
podman inspect whoami --format '{{ index .Config.Labels "io.containers.autoupdate" }}'


Final take

If you want systemd-managed containers on Linux without bringing in full orchestration, Quadlet is the cleanest day-2 operations model right now.

You keep:

  • rootless security posture
  • declarative, reviewable config
  • native systemd lifecycle + logs
  • built-in update workflow with rollback support

That’s a solid production baseline for single-host services.


References