rationale Link to heading
- need to compile podman image on laptop because vps/instance has low ressources
on laptop Link to heading
create directories
mkdir -p pods/caddy && cd /pods/caddy
a build file
- here version is hardcoded you can use latest
~/pods/caddy/caddy.build
ARG CADDY_VERSION=2.10.0
FROM caddy:builder AS builder
RUN xcaddy build \
--with github.com/caddy-dns/ionos \
--with github.com/caddy-dns/ovh
FROM caddy:${CADDY_VERSION}
COPY --from=builder /usr/bin/caddy /usr/bin/caddy
before building check for existing conflicting images
podman images
if so delete it
podman rmi localhost/caddy.vps1
now build
podman build --no-cache -f caddy.build -t caddy.vps1 .
once built export in archive
- check if .tar filename already exists otherwise you’ll get
Error: docker-archive doesn't support modifying existing images
podman save -o caddy.vps1.tar localhost/caddy.vps1:latest
copy image to your vps/instance
scp caddy.vps1.tar myuser@myvpsip:./
on vps Link to heading
before importing check if there’s conflicting images
podman images
if so delete them
load the built image
podman load -i ~/caddy.vps1.tar
Loaded image: localhost/caddy.vps1:latest
then tag it
podman tag localhost/caddy.vps1:latest caddy.vps_1:latest
you can now use it in a podman-compose.yml
---
services:
caddy:
image: caddy.vps_1:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro,Z
- ./logs:/srv/data:z
env_file: "caddy.env"
environment:
- ACME_AGREE=true
restart: unless-stopped
...
troubleshooting Link to heading
if at some point you need to prune everything
podman system prune -a -f
ressources Link to heading
https://docs.podman.io/en/latest/markdown/podman-save.1.html